Help with Exiting Common Event Picture Based Menu

This is probably a simple fix, but I'm at my wits end trying to figure it out.
I have a Common Event Picture Based Window that works well EXCEPT I can't figure out how to exit out of it by using the ESC key a second time. I've tried variables, switches, autorun common events and nothing works.
I want the player to hit ESC to bring up the Common Event Menu, and once the player is done, be able to hit ESC again to exit the menu.
Right now with what I have, the Menu doesn't even bring up (but the SE plays, so I know it's trying to). If I don't put in a Conditional Branch saying "Script:Input.isTriggered("#esc");" then the menu works great, but I can't exit out of it.
I've included pictures below to explain what I mean. The code below "End" is just the code for the menu itself.
I apologize if my explanation is lacking and appreciate any help.
(Also, I'm using QInput for my Input Script Calls and Gimmer Core to Stop Player Movement in case it looks different from vanilla Script Calls).

Edit: Switching the Menu Open Event to Autorun and adding a wait of 1 frame has fixed the menu opening problem, but it still won't close.

Edit 2: I think I figured out the problem. The Common Event keeps trying to run itself if I press ESC even if I'm trying to exit out of it. I don't know how to fix that though ;w; I thought variables would work, but I can't figure out how.
If you need help, you're going to need to provide more information. Instead of cropped, partial screenshots, you'll need to show us how the entire menu is structured.

You should also provide links to the plugins you're using, because no one is going to know off the top of their head why you're doing Input.isTriggered('#esc')
Look like he's using these:


I just happened to peek in because I eventually need to know how to code custom event based picture windows myself to do custom menus so wanted to see how the thread turned out.
I apologize. The Plugins I'm using are
Gimmer Core (To Stop Player/Event Movemnt): https://github.com/gimmer/RPG-Maker-MV-Plugins/tree/master/Plugins/Gimmer_Core
QInput (To remap keybinds): https://quxios.github.io/plugins/QInput
as well as
QPicture (For Mouse Hover Compatibility): https://quxios.github.io/plugins/QPicture
TDDP_AnimationCurve (For Image Animation Tweening): https://forums.rpgmakerweb.com/index.php?threads/animation-curves.108388/

The full code is attached in pictures below. There are 13 Other Common Events but they are for Show Picture/Erase Picture Commands (for now). If I need to post them I can, but I think it would be too long/redundant and I made sure all pictures are erased using the Cancel Menu Event in the last picture.
Thank you for any help you can provide!

I figured out that the reason this was happening was because the game was registering pressing "esc" for both ending and opening the menu. (It worked fine if I changed the second "esc" press to "shift" to close the menu). I solved it by adding more waits, but I felt like it wasn't responsive enough. So instead I added buttons that the player clicks on to open/close the menu.

This thread can now be closed.
This thread is closed due to being solved. If you need it reopened, let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/help-with-exiting-common-event-picture-based-menu.169289/