I dont think you can retrieve stuff once it falls into the pipe unless it catches on one of the upper levels, the bottom of the pipe constantly spews lava upwards, and you can drain the pipe but it might be extremely !!risky!!.
as for capping the pipe. there are two methods of quickly capping the lava pipe. The Easy way and the super easy way.
The easy way is to build a drainage system that drains the magma into a giant resevoir lowering the level in the pipe which prevents any imps from leaving it. (imps swim in magma, if the level is too low they cant exit the pipe.)
The really easy way is to cap the pipe with water. Basically go a floor above, make a floor/bridge structure, rig to collapse/retract, fill the structure with water and let her rip. This is a similar process when it comes to making an obsidian factory. (note obsidian factories use bridges for continued operations)
As for workshops.
in each of the workshops designs there are dark green X's these represent impassible tiles which, if placed over a hole in the floor over magma, will seal off the hole. You only need one tile accessable to magma, so with smelters you'll want your northern tile accessable and with forges you'll want either your east or west tiles open.
and for future fortresses.
you dont have to build right ontop of the pipe for magma access. with planning you can carve out a magma resevoir and breach the pipe for magma access. when doing this you can craft/designate a fortification to be placed, and with taht you can prevent the imps from coming through (supposedly) I'd still practice using the inaccessable spaces on the workshops to your benifit. Better safe than !!sorry!!