Put an empty event in the space before entering the hallway and set the trigger to player touch.
NPCs can't walk on other events by default, so you'll have control over where it walks. You also set it to player touch, because if you are standing on that event and it is triggered by the action button, you won't interact with what you intended to.