Incorrect Loop for Positioning Linear Actuator

The switch i wired one leg to A1 and the other to ground. If the delay is not right, should it be moved. If I remove the whole button function and preset the swcnt it works perfect - none of the extend/retract that you see in the serial monitor