You have "Wait X seconds" in these events, so when you are pressing Z repeatedly, you are creating multiple wait-threads, producing chaos.
You need to add a flag (a variable) indicating that the dialogue is in process, and check for this flag on Z pressed.
Also, it's a good idea to use Timer behavior instead of Wait, it gives you more control, as you can cancel the timer, check if it's running etc.