Instead of wait, you could use a timer. That gives you much more control.
On input trigger (or timer end), you display the next line. To cancel, just stop the timer so it never triggers.
I'd recommend implementing a way to import and refer to dialogue text from a project file, so that it is not hardcoded into your events and easier to change in the future.