Interrupting a delay

I'm looking at the other way round.

Think about what an interrupt means. You are sitting home, on a rainy day, watching a football game. The doorbell rings (that's an interrupt). You answer the door, to find a girl scout selling cookies. You buy some, and close the door. What happens next? You go back to watching the football game. That's what happens next.

You do NOT hit the kitchen, get the ice cream out, and have a bowl of ice cream with the cookies you just bought.

But that is what you want your code to do.

The key is to read, understand, and embrace the blink without delay philosophy, and get rid of the delay()s. Without delays, you don't need interrupts.

When the trigger is released, you note the time. Periodically, you see if the trigger is off, the gas is on, and the trigger has been off long enough. If the trigger is off, the gas is on, and the trigger has been off long enough, turn the gas off.