For stations, justifying a new station with a method that takes changing dynamic systems into account is fairly simple: Run "fake ship" calculations based on all points of interest in the system:
1. Timer ticks off once every x minutes; the AI has all the requirements for building a station, so it can actually think about building one.
2. decide where to place the station. Choose a random spot that's near either a planet or an asteroid field.
3. start a "fake ship" in each asteroid field with the goal of depositing resources, and see if it would visit the station, or one that already exists, or a planet, etc. All market prices should be "averaged" - because, after all, this station will exist throughout all market price fluctuations, and you want to find the average.
4. start a "fake ship" at each planet with a goal of transporting resources, another for buying weapons, etc, and see where it goes. Use the same rules as above.
5. start "fake ships" at jump gates with various goals. Continue counting how many hypothetical visits our station gets.
...and so on. If the station "scores" fairly high - if ships are likely to visit this station over other available places, then the cost is justified. "Justified how?" Simple again. Say you have a station where there are (or were) 10 visits a day when it was brand-new. Our new hypothetical station gets 11 hypothetical daily visits. Therefore, if the stations are roughly the same cost, and the first station was worth building in the first place, the second station is
also worth building. Each time you add a new station, you see if it scores higher than the highest-scoring station.
This entire calculation probably took so little CPU relative to everything else going on that you probably didn't notice. If we spread them out (which we absolutely can), we'll have even less FPS impact.
New colonies? You can do the same thing there as with stations. See how likely it is to be used.
Ships are a different beast entirely, though. You can't place a hypothetical ship and see whether other ships will visit it.
Instead, build ships if you have no down time for any of your ships - if it's mining ships or transport ships. If it's fighters, you can check to see how often they're used. If it's anything larger - things meant for large battles - see how effective each was in the last few major combat events. If it was fully effective, buying another could be useful. If it didn't have much to do, or didn't deal much damage relative to its cost, buying another is probably a bad idea. If it did well but was taking too much damage, buy ships meant to protect it.
As to warp rails, currently they don't seem to actually have any monetary "benefit" - they only affect time taken to travel. The algorithm there is a little more complex.
1. Timer ticks down, and you have the ability to build warp rails.
2. Count all your current ships going between two major points in a system - say, you have 50 miners traveling back and forth between a single planet and an asteroid field. Now, tally up how much time is wasted on the entire trip between them. (if the trip is 15 minutes, 15 minutes x 50 ships = 750 minutes total)
3. Figure out how much total time would be taken up if there was a warp rail in place. (Let's say it increases ship speed by 10 times.) 1.5 minutes x 50 ships = 75 minutes total, saving you 675 accumulated minutes per trip.
4. How much time did the last warp rail in the system save for the faction that created it, when it was created? Figure out if the current warp rail will save more for you. If yes, you can continue.
5. See if there are any other opposing factions in the area that would be benefited by the new warp rail more than you would be. If there are, building that warp rail is probably a bad idea.
If everything is a go, you can build the warp rail.
Working out the balance:
"But Tal, how do I decide whether to build a warp rail, station, or ship?" Yeah, that's the core issue, right?
There probably will be no clever solution there. What you'll have to do is add multipliers to each "type" of score (combat ship, economy ship, station, warp rail) and then manually balance them against each other with those multipliers, so that the outcome of them is "equal" - that is to say, that the game is able to nicely choose when to make what. You could even have those values affected a bit by AI personalities!
(the values in question being, 1. Hypothetical ship visits to a hypothetical station, 2. How much profit-per-economy-ship you're making, 3. Damage dealt per ship, and all the other mess 4. Minutes saved by hypothetical warp rail)
It's not an elegant solution, but it works, and it's not too far removed from how an actual player might go about it, either.