Controlling an output based on level of AC signal
A comparator might provide a simpler way to sense the 50 Hz. incoming signal. An open-collector type comparator doesn't need a detecting diode - it simply discharges a capacitor every cycle.
If the R1*C1 time constant is chosen properly, the capacitor is discharged before its voltage reaches the MOSfet gate's threshold voltage.

The circuit shown includes a 400mV reference voltage on the comparator's inverting input. The comparator includes a 4mV hysteresis voltage which adds a bit of noise immunity. The threshold voltage can be raised to set the sensitivity level by adjusting R4. In the schematic below, it is 50k, which provides an input voltage DC of 0.196V. Riding on top of that is the 50 Hz signal (0.3v peak in this case).
Response time is very fast (within half a cycle) on "light-go-on" event, and slower at 40ms for "lights go off" event. 
R3 represents a simple load - your infrared LED could be included in series with this resistor. An opto-coupler LED would likely require less current, so R3 would be sized to provide 10mA - 20mA current.