The LM339 circuit is a window comparator. When the voltage from the control transformer is higher than the 1N4735 zener voltage, the lower triac is turned on thru the MOC3022 opto coupler which applies the input power to the center-tap of the transformer (this is wrong, the other triac should be the one turned on). When the voltage from the control transformer is less than the voltage of the 1n4735 zener, the upper triac is turned on which puts the input power to the whole primary of the transformer. If the outputs of the window comparator are swapped, this circuit should work.