Because event 35 - 38 are subs under 'is sight', 'it' can only change direction when 'it' sees Player.
On the moment 'it' can't see Player, 'it' keeps moving in the direction that it was allready moving. 'it' just cant change direction.
Bring those events outside the 'is sight'.
Also, the animation changes to 'sleep' when 'it" is not seeing the player. But there is no action that makes 'it' actual sleep', if sleep = also stop moving.