Placing icons Xs inside precast wall

Hello! I am working on making a definition that allows me to place icon x’s inside of a precast wall panel, and I have run into some roadblocks and am unsure how to move forward.
Right now the script works by selecting a face of a precast panel, finding points on all 4 corners, moving the points inside the panel and creating a rectangle from those 4 points, then it places point on the new rectangle and icons at those points. the spacing is determined by a smaller scrip above based on some parameters we need to meet

First off my script looks like a mess and I’m curious if there is a smarter way to achieve the same outcome? I was able to place a single icon in the past using a different script, but wasn’t able to move past that so I started fresh and this is what I came up with (after severally failed attempts).

Second, the scrip runs great as is right now but as soon as i move it to a different panel that is 90 degrees from the current one it places every thing on a 45 and not on the panel.

Third, Since the scrip is making rectangles inside the panel its not looking for openings. I tried this with the geomertry.doesintersect but I realized those opening wont be made by those 4 points.

This is one of my first scrips I have made and I am still learning, any help would be much appreciated!!
I have included my script and some screenshots to help illustrate




.
Icon_plcement.dyn (207.8 KB)