For a typewriter effect, have a look at the
FAQ.
For everything else, something like this:
[code]
GlobalVariable Clicked = 0
On key X pressed:
Player is overlapping object:
Clicked = 0:
Player is [not] moving: (press i to invert conditions)
-> Set Text to X
-> Set Clicked to 1
On key X pressed:
Clicked = 1:
-> Set Text to " "
-> Set Clicked to 0
[/code]