I understand step one easy enough. Here is how you can quickly short the shapes in ZOrder. I then Intersect the back and front shapes, deleting the front. I am a little confused on step 2. It would be help if you attached a .cdr file that showed the results after each step.
Here is this code to get you started:
Sub IntersectMe() Dim s As Shape Dim sr As ShapeRange Set sr = ActiveSelectionRange sr.Sort "@shape1.com.zOrder < @shape2.com.zOrder" Set s = sr(1).Intersect(sr(3), False, True) End Sub
Hope that helps,
-Shelby