Event ends based on steps taken

Hi! I'm trying to make a sort of stealthy game.
How I've gotten it to work, is that once the player is spotted by an enemy, all events(NPCs) on the screen will move into "Alert Mode" and start to follow the player, and a battle will ensue once an event touches the player. This works fine.

However, I want to end the "Alert Mode" and have all events return to their original positions after a certain number of steps are taken, but I don't know how to do this. Can anyone offer me any help?
I'm not a hugely advanced RPG maker creator, and I never use scripts; but I thought I might try to help a little, since you haven't had a response yet.

How do you turn on your "Alert Mode"? Is it by using a switch?

The way I would try to do this would be this way:
- Before the NPCs start to move, save their initial coordinates in variables so that you can teleport them back there (not a clue how to actually make them WALK back though, since it would be a totally random pattern... Seems impossible without a script to me)
- It would be hard to try to count the number of steps an NPC takes; maybe instead, use a parallel event to wait a certain number of frames, and once that time is off, have it switch off Alert Mode and teleport the NPCs.

I hope this helps... It's not much though.

(Actually I would also like to add a stealth feature into my own game. I was wondering how your NPCs spot your playable character? I'm very interested in this ^^)

Original thread: https://forums.rpgmakerweb.com/threads/event-ends-based-on-steps-taken.94809/