Would it be worth it for Sunspear to enhanced its harbor and use the Greenblood to pull trade away from Oldtown? What would a ruler have to do and how soon could such a project be pulled off?

I don’t think so. 

First, Sunspear isn’t on the Greenblood (it’s a good bit north of the mouth of the Greenblood), so it would really make more sense to build up Plankytown (which sits at the mouth of the Greenblood. 

Second, as far as I can tell, there is no harbor at Sunspear. Indeed, when “Princess Nymeria and her ten thousand ships made landfall” near Sunspear, she did so “on the coast of Dorne,” beaching her ships rather than anchoring them at a harbor.

Third, it’s not clear how easy it would be to pull trade off of Oldtown from such a location. Yes, you have the Greenblood, but those waters reach their terminus in the middle of the Dornish peninsula and it’s a long caravan route indeed to get into the Reach or the Stormlands. By contrast, Oldtown is located in a much more populous market and has access to the great heart of the continent, either taking the Roseroad up to Highgarden (which then gives you access to the Coast Road and Casterly Rock) and then to King’s Landing, or taking the Mander as far north as Silverhill and as far east as Tumbleton or Grassy Vale. 

The Myraham is called a trading cog from Oldtown. 1) Does that mean that its captain pays taxes or fees to Oldtown? 2) Does he own the ship? Or do the Hightowers own it and the captain just uses it in return for taxes? 3) Does this apply to all trading vessels in the Seven Kingdoms? 4) Could King’s Landing have had a merchant fleet, or it never needed it?

It means that whoever owns the ship, and it could be the captain or it could be a merchant or a consortium of merchants or a nobleman (although that’s less likely), is based out of Oldtown. 

In terms of taxes and fees, you’re dealing with two things. The first is that the owner/s pays taxes to House Hightower by virtue of being a resident of Oldtown, but that’s no different from any baker or blacksmith who also is a resident of Oldtown. The second is that when the ship is in Oldtown, it pays tariffs and excise taxes, harbor fees and warehousing fees, the same as any other ship in the port (although it’s quite likely that the Hightowers charge a lower rate to resident merchants as a way of stimulating local commerce). 

Looking at the sources, it doesn’t seem like the Hightowers have a proprietary trading fleet in the same way that the Redwynes do – rather, the Hightowers’ navy is meant to “to protect his trade.” Nor does King’s Landing have a proprietary trading fleet; they have a lot of ships based out of that port, but the crown doesn’t own them directly, although Littlefinger probably bought quite a few of them using embezzled royal funds.