If you're seeing the "rebooting alarm" message, I can't see any reason in the code why your digitalwrites wouldn't be executed. Looks more like a hardware problem. There is an issue with the code here:
if (alarmState = 1)
Where == should have been used, but it didn't cause your issue.