No comments on the code. I wanted to add that solid state relays are great for applications like this. I have gotten any number of good SSR's from ebay and Criagslist.
One thing you must do is make sure you have a heatsink on the unit as it does not much inefficiency at 1000 Watts to toast out a solid state device.
wade