R1 provides around 30 mA to the sensor. D3 limits the voltage on the sensor, and C4 will reduce the effect of noise.
When the sensor activates, the voltage on the sensor wire goes low. That is connected via R2 to pin 1 of the IC. Pin 1 is the not-A input, and when that goes low, the output, pin 12, goes low for a short time. Pin 12 is connected via R4, Q2 and Q3 so when the pin 12 is high, the relay is on.
I think that in normal running, there are continuous pulses from the sensor, so pin 12 is always low. When the pulses stop, the pin 12 of the IC goes high and the relay operates.
When the relay operates, it connects T5 to T6, the ones labelled "sensing edge input". I guess that reverses the motor. I don't think that the relay can operate for long times, because D5 would get quite hot if it were run for a long time.