You can increment a variable every 0.2 sec by 1, and lets say when it gets to 10 close the game.
You will need 2 events
on key being held down esc,every 0.2 sec, add 1 to timer
timer == 10 -> close game or what you plan to do
This will exit the game after 2 sec holding the button, also if lets say player stops holding the button before it gets to 10 you have to reset it to 0, you can do this by inverting the event and changing the action to set timer 0.