If you can build movable units just as you could structures, here's an idea.
Make the shipyard a vehicle, with a special locomotor.
This locomotor has speed 0, It's BehaviorZ="SURFACE_RELATIVE_HEIGHT" and its PreferredHeight="0", if things go well, it should stay ontop of the water, regardless of the depth and it shouldn't be able to move.
but of course, part of this problem is not being able to place on the water in the first place right? in which case, some sort of deployable structure may be the best option, perhaps though, if the structure has no geometry it might work, if it does, you could use a granted upgrade or death timer to replace the building with the right version that has geometry.
Another option, would be to use the Scrin Growth Accelerator method. Have preplaced objects on a map where a Shipyard can be placed, all you have to do is set the Shipyard's BuildOnRequiredObjectKindOf to the kindOfs corresponding to that special object. It would work very much like Act Of War: High Treason's method.