Event/variable based battle system

So I have created an event based battle system, however I am having an annoying bug appear every now and then!

Sometimes the player will simply end up turned left and the event seems to stop running! I have created a stand alone "game" with just the battle system in it, if anyone could point out what might be causing the bug I'd be a very happy man!

DL: https://www.dropbox.com/s/cwxc185dff38ww4/Eventbattle.exe

Needs RPG Maker to run!

Original thread: https://forums.rpgmakerweb.com/threads/event-variable-based-battle-system.24393/