Creating outerlines

Why not use the top surface instead?

Filter for the horizontal up surfaces, get the perimeter curves, group by curve loop (GroupCurves node from Archi-Lab), create a polycurve, make a new surface by the patch, filter to get the surface with the largest area, and pull those perimeter curves.

Another option would be to project the whole geometry onto a plane, and use the that as your perimeter curves. Not sure which would be faster.