As NW_Kohaku said, it works. I've used used pumped magma to obsidianize cavern lake entrances with retracting bridges to let the magma through. Note that the mechanism has to be magma safe as well, though.
I've experimented with a dwarven 3D printer for the building of 20+ level high walls to seal off cavern entrances, but the construction generally fails after a short while due to "impossible" obsidianization under/through a bridge which can only be removed by dismantling the bridge, so I've given up on that idea.
For the drydock/ship works, I'd first drop magma on the water to create the floor (can be done by a basin of magma you drop in one go, but it can't be too large, or you'll get problems with magma evaporating as fast as you add new magma, so if it's a huge bottom, I'd do this in several sections), and then build the sides by creating a mold where I'd let magma flow into the mold from the side. This construction should be done such that you can increase the level of the magma flow entry point to the top level of your hull, implying the top level of your magma pumping flow source should be level with the top of the final hull. I'd build a water dropping system (at least) one level above the top of the hull, where a channel contains the water, and the bottom of the channel consists of retracting drawbridges connected to a single lever, so once the magma has covered a single hull level, I'd stop the magma influx and pull the water drop lever. I'd have a drawbridge block the flow of water to the water channel to speed things up (otherwise extra water will spill onto the newly formed obsidian, forcing you to wait for it to dry). Once a level has been obsidianized, refill the water channel and raise the magma input level one step.