Instantly close messagebox while activating a switch?

Hello! I posted this in the other VX Ace forum but nobody there seems to be able to help me.

I'm basically trying to call an evented menu through a button while in the middle of a dialogue box, but it doesn't seem to be working at all because of how Window_Message basically disables all other events from running.

My theory is that I could basically do it by instantly closing the messagebox if I press W for example, and if I press W, it simultaneously activates a switch that will trigger a conditional branch placed after each message to activate the evented menu, and then it will jump back to a label once the menu is exited basing on a variable.

Is there a script that can do this or is there a better way of doing it?

Thanks in advance!

Original thread: https://forums.rpgmakerweb.com/threads/instantly-close-messagebox-while-activating-a-switch.33718/