Boshimi is correct...if at a particular gravity well a refinery is more profitable than a tradeport, then you of course want to build as many refineries as possible, which is 3 for the reason pointed out...
A refinery gains .06 metal/crystal from each nearby extractor (.08 from neutrals)...a trade port however gives 1 credit per second...using the equivalency that 4.5 credits equals 1 metal/crystal, a refinery is more profitable than a trade port with just 4 nearby extractors...
However, the length of your longest trade route adds a bonus to all trade income (7.5% per node)...with a 6 node trade route, you would be looking at a 45% bonus, meaning you would need 6 nearby extractors to be more profitable...
However, that is just looking at the economic profit...it is also important to take into account the pay off time...since refineries are about twice as expensive, you essentially would need 11-12 nearby extractors to have a refinery payoff itself in the same time interval as a trade port...
There are other compounding factors, such as the length of your trade route, technologies that boost trade but not refinery output (such as the Vasari's), and neutrals (which help refineries be more profitable)....in general though, refineries take a lot longer to payoff, and my analysis used a trade route of 6 nodes...it is quite common for eco players in large games or any player on smaller maps to have much longer trade routes, which makes refineries even harder to justify...
This is why simply making refineries cost the same as trade ports would go to great lengths....the primary advantage of the trade port is not actually its profitability, but its short payoff time...furthermore, reducing the bonus received from your longest trade route would make the competitiveness of refineries less dependent on the length of your longest trade route...
I know I sound like a broken record, but these really are the only two changes you need to make refineries easily comparable to trade ports....