Eventing Menu

So I've been eventing my own menu using the Global Common Events script, and pictures.

The player opens screens by pressing the enter button. But when they open a screen while next to an "action button" trigger event, the event in question will start to run while the player is in the "menu"-- and that causes a lot of problems.

What I need to do is make it so events are not accessible while in this menu. The default menu does this-- all events pause and are not intractable. I've tried to find the script that does this, but I'm not very familiar with code.
The solution I'd most recommend is to simply use a different button for the menu (Esc is the most common), but if the menu is controlled by a switch, you can set your events to only run when that switch is off.

Original thread: https://forums.rpgmakerweb.com/threads/eventing-menu.108242/