Puzzle Complete, Monsters Spawn

I want to have an area be random battle-free until a player solves a puzzle. Is there a way to do this?
Use the event command to switch on/off the random battles.
An autorun on map enter to to check if puzzle is solved, switching off if not and then erase event for the autorun.
And an additional switch on on the puzzle itself as well as on every transfer out of the map.
Could you be a little more specific in those instructions, please? I can't quite grasp all of that with the way you worded it.
I am at work right now (don´t worry, I am on break) so I can´t help right now but I can probably do a screenshot of the necessary event when I get home.

Original thread: https://forums.rpgmakerweb.com/threads/puzzle-complete-monsters-spawn.91715/