I'm working on an event. It's a soldier blocking your path. You should be able to talk to him and, based on whether or not you have the quest, get different replies. Once you have the quest he has some dialogue and then moves to allow you access to the dungeon. He also provides a key item called a rescue horn if you don't already have it in your inventory. If you already have it he does something else and doesn't give it to you. All that up works fine so far.
The problem I'm having is after he moves. I had to set a self switch so he would not move a second time when you talk to him or else he is trapped and the game just halts when he tried to move again and can't. Now, though, if you leave the zone and come back his position will reset but the overall event will not so he will act as though he has already moved and not move again thus blocking your path. I've attached screenshots of the event code.


Thanks in advance for the help!