It's strange that you asked this question but you didn't use the toggle action hehe. There is a toggle boolean action you can trigger when you press escaped, that would work on its own.
The reason why it's not working for you here is because in Construct it runs the events from top to bottom so by the time it triggers the second event the variable is set to true and sets it back to false. You can use a sub event with an Else to get this to work, where Xis Pause Else is Pause will trigger only one time, or as mentioned above the toggle action on Escape pressed.