it depends on the map and such - For instance, I will often place a command station right next to the wormhole leading to my home system, merely because the forcefield I usually place over it will provide both protection for my command station, and a shield against hostiles entering my home system.
Of course, if there is a advanced factory, I will usually place the station next to the factory so the forcefield can cover both the factory and the command...
Although if I am hopping over some planets, I will tend to place the command station somewhere outside of the wormholes, just because of passing ships and whatnot.
Often, however, I dont find a problem with astro trains. Sure, they are annoying, but I seem to have been getting lucky as of late with train station spawns.. my last few games have had very few trains through my systems