Enclosed_polylines is about finding EACH closed area in a selection. If it's not what you are looking for, then you should explain better.
I'd really like to see each of the 2 samples you already posted, but with both "before" and "after" situation.
And, most important, how do you see them the same? For me, looks like 2 different tasks.