You've got it. Stick the button in a while loop with a shift register
initialised to 0, wire the button to a case structure and set the mechanical
action to "latch when released". Now the wire the shift register into the
case statement. Now you need to check the the shift register value is 2 or
less. Wire the output of the "<" to another case statement the true case is
where you put your action and zero the shift register, the false is where
you increment the shift register