Inserting IR sensor code into existing project

Ok so I need leave my current hardware into the pins I originally had?

Good question. My layout is a relatively small loop with long trains. The trains occupy too much of the track to separate into blocks. The train would always be running on approaches. I also do not have powered turnouts. All hand throw switches. So I do not have turnout position feedback. I personally like this level of reliability on the layout.

So what I was thinking was to manually select a signal indication at a control board with a push button. Then have the IR sensor do the "drop to red effect" to give it some realism. then when the train clears, it will return to the selected indication. This will allow me to sit back and just let the train run.

I know others that do resistor wheel sets on all there rolling stock and do occupancy detection. But I would prefer to stay away form the level of complexity.

Thanks!