You've explained that when pin2 goes LOW (a diode drop above ground) when the light to the phototransistor is blocked, the output goes HIGH.
I was just wondering if the IC's purpose was to "debounce" the sensor output, i.e., remove transient fluctuations in voltage level. Now I understand that that is indeed the case.
Thank you for your explaining it to me.