Before the train goes into the portal (and after the drive to portal command icon on the drivers list) add the commands you want the train to execute when it comes out of the portal again. Basically the portal command is just like any other command in the sequence except you can't see the train. This works most of the time - you do get the odd glitch!
Chris