which makes me suspect this code may keep sending out commands repeatedly while the button remained pressed.
Why? The ! in there says to do something if the switch is not pressed. Presumably that something results in the switch becoming pressed.
which makes me suspect this code may keep sending out commands repeatedly while the button remained pressed.
Why? The ! in there says to do something if the switch is not pressed. Presumably that something results in the switch becoming pressed.