Perpendicular intersection of array of points

I am trying to do the set difference of these sets on both axes as shown in the picture but I don’t want the intersecting line to get affected by the set difference. I want both the perpendicular lines to get affected by the set difference. Can someone help me do it? I am attching my script here and some pictures



I want only the marked lines to be affected.

Set difference.gh (25.7 KB)