I reckon it'd be a lot better code if it was properly written 'software PWM' running at some pure multiple of the mains frequency rather than using nasty delays.
The existing Arduino hardware PWM would be too fast / not phase-locked from the mains cycles.
That would also make it easier to integrate other functions into the same Arduino sketch