The Arduino can't read the negative half of the waveform and it can be damaged by negative voltages.
You can rectify the AC (but don't forget about the diode drop) or you can [u]bias[/u] the input or use a [u]protection circuit[/u]
if (sensorvalue <= 400)
What does 400 represent? Is that the value at the 90 degree peak? If so, your logic is "backwards" because it's less than 400 before you get to the 90 degree peak.
It's also "tricky" to find the peak (because of normal analog variations). It's better to find the positive-going zero-crossing and calculate the time to the peak. (In the real-world, it's often best to find some known-point after the zero crossing, but before the peak.)
Wit a real )electro-mechanical) relay you'll have to compensate for the turn-on & turn-off delay (which you'll have to determine experimentally with an oscilloscope) and it will never be "perfect". AC solid state relays (usually made with TRIACs) have their own problems (as has been pointed out). But, if you never need to get negative voltage out you can use a transistor or MOSFET (depending on the current & voltage requirements).