Need help with Event not working

I'm trying to make a game mechanic where you can enter an arcade machine and take control of a character, but be able to press a button to leave the machine at any time. I have the event for entering the arcade machine working, but I can't figure out how to make the event for exiting the arcade machine.

I tried using autorun and copying the same code from the first event, and that didn't work. I tried using parallel and using a conditional branch, but that just resulted in a black screen. I'm at a loss for what to do.

Pictures of Enter Code and Exit Codes are below.
your info is incomplete, so I can give only general help:

1) a transfer to a different map stops and deletes all events on the previous map. because of this the command "transfer player" should always be the last command, anything after that should happen in a new event on the new map.
sometimes the old event completes before it is deleted, but you can never guarantee that.

2) parallel processes need waits to work correctly, especially if there are multiple parallel processes running.
and that is the info that is missing: what other events are running in that map on autorun or parallel? Because without waits multiple parallels can block each other - but too many waits and they will no longer work at all.
your info is incomplete, so I can give only general help:

1) a transfer to a different map stops and deletes all events on the previous map. because of this the command "transfer player" should always be the last command, anything after that should happen in a new event on the new map.
sometimes the old event completes before it is deleted, but you can never guarantee that.

2) parallel processes need waits to work correctly, especially if there are multiple parallel processes running.
and that is the info that is missing: what other events are running in that map on autorun or parallel? Because without waits multiple parallels can block each other - but too many waits and they will no longer work at all.
There are no other Parallel or Autorun processes on either of the two maps. I'm going to try putting "transfer player" at the end of the second script to see if it works.
your info is incomplete, so I can give only general help:

1) a transfer to a different map stops and deletes all events on the previous map. because of this the command "transfer player" should always be the last command, anything after that should happen in a new event on the new map.
sometimes the old event completes before it is deleted, but you can never guarantee that.

2) parallel processes need waits to work correctly, especially if there are multiple parallel processes running.
and that is the info that is missing: what other events are running in that map on autorun or parallel? Because without waits multiple parallels can block each other - but too many waits and they will no longer work at all.
Placing "transfer player" at the end of the script seems to work. Thank you very much!
The two event pages you have here call on a common event, but you didn't screenshot the code for the common event.
The two event pages you have here call on a common event, but you didn't screenshot the code for the common event.
Sorry, I forgot. Here are the two common events.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-event-not-working.143507/