This is an extremely interesting point, the worth of fighting pirates and guerre de course seems difficult but is completely worth the effort. Strangely, just before reading this post, I finished the book To Rule The Waves by Arthur Herman, which asserts that the rise of large-scale trade went hand in hand with the growth of British naval strength, and points very specifically to the 18th and 19th centuries. On page 402, he asserts that it was only naval protection that enabled British trade to grow considerably during the Napoleonic wars (over 11,000 British merchants were captured by the French from 1793-1815 and far more would have been but for the British blockades and convoy protection). How much can one measure the cost-to-yield of maintaining peaceful trade against such depredation?
Herman also argues that Naval research and technology drove the development of far better seagoing technologies without which large-scale merchant ventures would have had far lower yield (perhaps the most famous example is the Longitude Prize) and the demand for iron and ship production was a major driver of the early Industrial Revolution. While I think that both of these arguments are very vulnerable to crowding out arguments, it seems to me that there were nuanced interconnections between technology, trade, and naval power that each had positive feedback into the others. It seems to me that by examining the very large investment made by the British East India Company in their merchant marine in this very period gives a parallel in which private interests made similar investments in protection of sea trade routes, showing its probable positive return on investment.
I am glad to see that you have recognized that naval production was almost always based on relative strengths of navies. The huge decomissioning trends of the mid-19th century in Britain was exceeded by that of their enemies/rivals (the Dutch had been weak since the late 1600s, the French were exhausted completely, and the Spanish and Portuguese were on a long decline worsened by French occupation). However, there is one major aspect to consider in examining naval strength longitudinally: complete revolution in ship technology. Steam, iron plating, and amazing advances in artillery picked up hugely after 1815, and the British navy in the Crimean War would have been unrecognizable to Nelson. I am not sure how this would affect your analysis, because navies became simultaneously more expensive and more effective, and GDP was exploding fast enough to support such high-tech advances without bankrupting the Brits. I am sure this is not an original problem, but I am interested in seeing how historical economists can control for such changes.
Good luck on this paper, it seems like an extremely useful examination with a lot of interesting complications and a fundamentally important commentary on the balance between maintaining law and allowing market determination of resource distribution.