First off, you might want to try removing
_obj switchmove "null"
, as I'm not sure this actually does anything.
Also try playing with the playmove/switchmove
However, I think your problem might be in the alert itself. Try changing how it is activated by something which you can guarantee, eg. put a trigger that detects when you walk in to it.
Alternitavly, I made this script a week of so ago, so you could use it.
_person = _this select 0
#loop
_person SwitchMove "FXStandDip"
~3
?(Alert1): goto "alert"
goto "loop"
#alert
_person SwitchMove "FXStandFromDip"
_person setbehaviour "combat"
_person setspeed "normal"
_person setcombatmode "red"
-=GC=-Fungus1999