What is this capacitor in this TSOP/voltage comparator circuit for?
The circuit from electroschematics is for a break detection circuit, and the 10uF cap is probably for a delay. The buzzer would sound when the infrared signal is lost (and a short delay from the cap). In the original schematic the detector is for a specific frequency (like 36kHz). When the 36kHz signal is detected, it brings its output high or low. The cap, with the RL resistor will form a low pass filter with a time constant of ~1 second. 

The internals of the sensors (GP1UX51QS or TSOP1236 ) actually look like this:


Source: https://media.digikey.com/pdf/Data%20Sheets/Sharp%20PDFs/GP1UX51QS.pdf

If your getting bad triggers, make sure your power supply is clean, you could still get bad triggers if the voltage came up and down quickly. Verify the output of the LM393 with an oscilloscope or logic analyzer (they are cheap, if you don't have one get one)  It may be beneficial to add some hysteresis to the comparator (which will require some math)