Someone figured out that you'd need a refinery with something like 13 resource asteroids nearby to be competitive with a trade port
Are you sure this is right? My own calculations come up with a much different value that often plays in favor of the refinery. Usually credits are used to purchase metal or crystal. So, for 4 logistics slots, you can get one refinery or one trade port. If you want to buy 100 metal, you need 400 credits, which means you need to wait 200 sec with a trade port. One refinery gives you 0.06 metal/extractor, so you need 1667 extractor second (strange units). To beat 200 sec, you need 8.33 metal extractors. My usual rule of thumb is to have a total of 9 or more metal/crystal extractors available to beat the trade port. This is easily achievable for a well positioned planet; you can sometimes get 12 or more, which hands down beats the trade ports. Disagree?
[The calculation becomes even more favorable if you include an uninhabitable extractor since you get 0.08 metal/extractor.]
When I am in econ position, I usually try to throw in a few refineries. The basic point is that you "don't want to go to market" either buying because you have too many credits or selling because you have too many crystals/metals. I try to get a balance. If I find myself buying, I try to get up some refineries; if I found myself selling, I try to add trade ports. And, of course, always try to get at least one ice planet and one volcano planet so that you have a good balance of metal and crystals. You can fine tune where you put up the refineries if you figure out what kind of fleet you plan to build, i.e., will your ships need relatively more crystal or more metal. This is a lot to figure out on the fly in a mutliplayer game, but if you're in the eco position, you can really help your allies by trying to balance all of this out.
Or, instead, if you don't like to think, go TEC and just get PERVASIVE ECONOMY. That's the dumb man's solution.