and only outputs when the button is pressed. It now works every single time I press the button. Only problem now is that it works every time... twice.
You want to do something when the switch BECOMES pressed, not when the switch IS pressed. Look at the state change detection example for how to fix your problem.