Turns 25-35:
Once you get Minuit, buy a second caravel and cannons in Europe. You should be able to buy ~6 cannons and 100 muskets/horses. Once your caravels are back in the new world, delete all your colonists until you have 100% rebel sentiment. Declare independence, pick all men are free and the bell-enhancing civics. Your veteran soldier and one of the indentured servants become dragoons. With 6 cannons and 2 dragoons sporting a +100% combat bonus defeating the Royal Expedition force is trivial.
I tried this proposed combat and did not find it to be "trivial". *(I was in quick game speed mode and playing rev diff.)
I do not question your strategy worked for you. I just do not know what you did to make it work during the combat phase
the king will come ashore with 9 units and you only have 8. hence each matchup must count. you need to at least wipe out all the dragoons and artillery in attacks you make from inside your city during the first combat round
cannons do only one thing "well", bombard a settlement to reduce its defenses 12% per turn. in that your strategy does not involve losing your only (coastal) city, I found the six cannons to be worthless in comparison to dragoons when attacking REF Vet 2 Dragoons and (unpromoted) Artillery (the bulk of the landing force) from inside the city
"2 dragoons sporting a +100% combat bonus"??? my dragoons can get up to a 50% bonus from rebel sentiment (100% - LB rate for colony, not city) which is larger than the Vet 2 promoted dragoons, but the combat odds around 78%, not infallible
Civ 4 Col unlike Col 1 does not allow you to pack up your tent and leave a colony empty (that does not have a stockade). given that fact would it have been feasible to have built an inland second city with a fort on defensive terrain to force artillery by themselves to reduce the city defenses without the help of the ships? in that case you would have to wait until the first city was captured to get your colony LB rate up to the desired 100%
in another game I tried abandoning the coastal city and moving inland about five tiles as soon as the King landed in the first wave. strangely enough it took the REF quite a few turns to show up inland and also to hunt down on the open seas my now departed caravel and merchantman. enough time for the inland city that if I had had more than one colonists to get my liberty bell rate up I might have got up to 100% LB rate. (in that game I only had one dragoon and 6 cannons left when I departed the coastal city)
--------------
in summary I would have been better off spending the cannon money on buying vet soldiers at the dock
what is the advantage of your strategy (which I could not make work) versus having 8+vet soldier dragoons fighting the REF instead?
or taking the time to get those 8+ vet soldier dragoons promoted to at least Vet 2 fighting natives or Europeans? (in which case San Martin would be a better leader due to double XP rate for combat units)
btw I found out the hard way a stockade and fort are worthless for a one coastal city strategy such as you outline since the King's warships will wipe out your fleet (if it ventures out of port) then bombard the city's defenses to zero in only a few turns. the King is also likely after the first wave to try amphibious attack of units from his ships, one of which wiped out one of my cannons (which are much weaker units than dragoons inside cities)
the only improvements useful for a coastal city in 40 turns are the dock (to help with food problem) and a warehouse (or wagon trains) to store excess guns and horses (bought in Europe). if you had more time a printing press and newspaper would be useful, as would be buying an Elder Statesman form the dock