Let's start with question 2... I can address that best:
> Is there an opportunity in Revit to replace the geometry of an element?
No.
> Can I call DirectShare to Solid, and then turn to the element and tell it to take this geometry instead of its own?
No.
> Or is there some other way?
No, not really.
Well, yes, of course, everything is possible if you try hard enough.
> The main thing for me is that after pruning there remains an element of the same family lying earlier, but of a different shape.
I once discussed with wood structure specialists who implemented very advanced Revit add-n for wooden framing.
They were forced to use Revit beams and columns for the Revit part of the functionality., but the geometry was totally inadequate, since they were modelling the results of CAD/CAM generated framing connections.
So, they added their own DirectShape geometry and maintained that in parallel with the standard Revit elements, and synchronised at all times.
It enabled a perfect super professional solution.
I imagine it took less than ten man-years to implement and fine tune.
I very much look forward to hearing how you end up solving your challenging tasks.