Creating a grid from irregular shape

I am trying to form a grid based on an irregular polygon. Conceptually, I think it’s pretty simple, but I am hung up on one part. I want to extract 2 separate pairings of lines from the pline that is brought in via Geometry Pipeline and then use tween curves to generate the grid. I could use split list until I get the 4 lines I want, but I want to do this so whatever shape I draw, in the “Boundaries” layer the script will find the most efficient grid. See Below. (I would post my script so far, but all there would be is Geometry Pipeline and then Explode)

What you mean by whatever shape I draw, if the shapes with 4 sides like in your image maybe you can create script to do that but if there are many sides or are all curved sides how you want create a grid?