@dhusolo
My code was meant as an example.
You need to monitor the pin that your you're using.
i.e the The pin you created with M950 and the P parameter you use in M581.
You have M581 T2 P1 S1 R0
try
M80 ; Power on
G4 S3 ;
if sensors.gpIn[1].value = 1 ; check if button still pressed
M81 ; turn off power
Not sure why you're using M582 in config.g
I believe it will cause the trigger to run as if you've pressed the button.