How to build an automatic Lego train system? I was wondering if anybody has ever tried using the IRLink NXT sensor to make an automated train system and if so, what kind of setup did you have to make it all work?

I have been working on a train station for a while now and would like to create an automated system that will stop the train inside the train station for a set amount of time (maybe 30 seconds). As of now, I had an idea to use the touch and IRLink NXT sensors to make the system work. When a train approaches the station it will somehow hit the touch sensor. Then the IRLink sensor will send a signal to the IR receiver stopping the train inside the station. Then after 30 seconds, the IRLink sensor will send another signal to the IR receiver which starts the train. This will be continuous as the train track setup, as of now, is in a loop connecting both ends of the train station. I would also apply the same system on the opposing tracks in the station.

Am I overlooking anything that might make this not work? Are there any better alternatives to the touch sensor? Does anybody have any ideas as to how to avoid a collision within the train station if two trains are approaching less than 30 seconds apart? And finally, are there any experienced NXT programmers that could give me some advice on the programming aspect of the system?

I like this system because the train does not need any positioning awareness on the track for it to stop within the station every time.
I think I'd use the ultrasound sensor instead of the touch sensor (or the brightness sensor with the light turned on in a dark tunnel). I haven't tried this but I'd worry about the touch sensor derailing or scratching the train. Otherwse, your system sounds pretty doable. The collision risk could be addressed by setting up the sensor a little further before the station and sending a stop signal to the second train if it triggers the sensor while the first train is still at the station.