To clarify some details:
The unit is placed OVER the land/sea border. This indicates that the ship is in port, but also keeps track of which port it is in (i.e. it must enter and leave by the same sea zone.)
Ships in port can be captured, but I suggest allowing the defender an attempt to scuttle the ships before any combat rolls are made. Perhaps allow one scuttle for each 6 rolled per combat round; maybe each attempt must be taken in lieu of a return fire from a defending unit, i.e. you target your own unit rather than the enemies? Each roll should target a specific naval unit.
This links with my campaign for wider oceans, with a minimum 2-turn Atlantic crossing leaving a “killing zone” for the U-boats in mid-ocean, or forcing the allied convoys to take the long route via Iceland/Greenland.
I’ve also suggested making every ship dock in port on each and every turn of the game. This can be at any time during the turn, and may just mean staying where it is as long as it can be demonstrated that the ship is within range of a friendly port and back (it shouldn’t cost movement points to move in/out of port).
This can make previously worthless island territories valuable fueling stops.
I mark important ports on my maps, these also serve as ship building and repair facilities. Usually they’re sited on the junction of a land and two sea zones, allowing ships to sail out into either adjacent SZ.