I found it!
I changed

if PORTA.0 = 1 Then second_pause

to

if PORTA.0 == 1 Then second_pause

Its now working correctly