Same button to enter and exit an infinite loop and control an input perpetually

This demo-code demonstrates how to use a momentary push-button as a toggle-switch
press once => ON
press again => OFF
press again => ON
press again => OFF
...

best regards Stefan