I think you unnecessarily added the following line:
else SetMonsterCourageAndMood(monster, 0, MONSTER_COURAGE_ALWAYS_FIGHT, MONSTER_MOOD_HOSTILE)
In your script, you mention the hero "Nicholas," and for him, you change the "mood" and "decision" of creatures. If a monster belongs to the Haven faction, its mood and decision are changed. In the next line, you already state that they should be aggressive towards this hero and always fight him. Perhaps I'm mistaken; I haven't created such specializations.
Some points in your script also seem confusing.
At least, that's what it was intended to do.