How to make a dialogue screen

I have made a dialogue screen. It takes the form of a set of 3 sprites and a text object. They are hidden behind the background and, when adjacent to a NPC and pressing Space they show up.

The problems begins here, I prevent the character from moving from this point on, and I can’t make it move again. I see the problem, I want to use also Space to finish the dialogue. I am not very sure of how the events are handled, they are nor really in order, because if I push Space nothing happens if the last event is the closing one.

I will push here an approximate translation of my events:

If Space button is pressed and DialogueScreen is in the top layer then
put DialogueScreen in the bottom layer
set ignore controls to false
end if
If Space button is pressed and PC is adjacent to NPC then
put DialogueScreen in the top layer
set ignore controls to true
end if

Thank you very much in advance.

First, I want to apologize for annoying with my issue so soon without trying it harder. And for my pour english too.

I finally ended up fixing it, here is my solution:

leyendoTexto is 1 when the text is being showed.
accionEnCurso is 1 when we are showing the text, but we are already in the same iteration that the action that hides it. So, it won’t hide it until accionEnCurso is 0.

So, we hace 2 variables. One controls if the action is ended. If in step 6 we are showing the text but in step 7, with same conditions, we are hiding it there have to be a variable which controls that step 7 don’t hides it if 6 have just showed it.

The other variable only exists to make it easier to read, it says that the text is being showed or hidden.

saludo is a text object. textWindow is a group of sprites representing a background for the text. The events hide it and show it to create the illussion that its an emerging window.

Example: