Visual novel engine

I am trying to make a Visual Novel engine script interpreter. What it does is, it reads simple instructions from a source like: “DISPLAY_TEXT: Hello world”, “SHOW_IMG: scene.png”.
I figured:

while(read_next_instruction())
{
handle_instruction(instruction);
}

This looks fine so far. If next instruction is DISPLAY_TEXT, handle_instruction() will display the given text on the screen, and then the while loop will keep on reading. The problem is, some instructions will have to wait for the user to click on screen so it can jump to next instruction, but how can I do this, if the while loop won’t wait for the user to click on the screen?