Chris - I'm sorry you are having so much bother. Here are a couple of pictures of mine to show how simple it is.
I take it you are now using a 5 volt feed to power it Ignore the "pull up" resistor on the output, it is not needed.
If you power up the transmitter side, you should, using a multimeter,between the output and 0 volts, be able to detect a sizeable drop in resistance, as soon as the detector picks up a signal from the transmitter. You can check this using a little mirror - and simply hold the chip in your hand and move it towards the mirror and away. If you connect these two leads between your 0v and your index input, this should give a reliable signal.
The only problem I can think of inside an enclosed space you are using is that the transmitter will be sending outputs all round the housing, and some could be bouncing back into the sensor.
Anyway - I really can't say any more - here are the photos. ( P.S. I dont have a problem with dirt - and if I do, it is readily available for the wipe of a cloth.)