I’m not entirely sure how
I’m not entirely sure how you have the components connected in your set-up. But I’d normally have the 220 ohm connected to the LED side of the sensor, which I guess you have being driven by the BS2 output on one side, and wired to ground on the other, essentially BS2 output to 220 resistor to pin3 thru LED to pin4 to ground. Transistor side sounds like Vcc to pin1 to 1k resistor and BS2 input pin, with other side of resistor to ground. Now normally, the arrow side of the transistor should go to ground which is pin1, and then pin2 should connect both to the BS2 input, and to the resistor, with the other resistor wire connected to Vcc, +5 volts.
I’d say the resistor on the phototransistor is probably a bit small. Looking at the datasheet you linked shows a collector current of about 1 mA on a good reflection from the 20 mA you have going into the LED side (with the 220 resistor). Using Ohms law, 1 mA x 1k equals about 1 volt of change, probably not enough to register as a logic change on the BS2 input. Try a 4k7 or 5k6 resistor to get a larger voltage swing. Even a 10k might be usable.
Or, you could try wiring it up like Parallax has for their QTI sensor on page 2, with code for this configuration.Note that I think 220 ohm is a better choice for the LED side of the sensor then the 470 ohm they have there.