Rotating multiple rectangle to be perpendicular to host curve

Hello! I am working on a script that draws multiple unique vertical supports based on a simple plane drawn in rhino. In the image below you can see the model I’m referencing/trying to accomplish (cyan) and the GH geometry that I’m having issues with (red).

I’d like to rotate the vertical supports so that they are perpendicular with the host surface/curve.

Any help with cleaning up my script and getting the desired result would be much appreciated!!! Happy to jump on a call with someone if it is easier to talk through.

Rhino model with reference geometry and GH definition attached.

24-0523 Maritime Wall_Working.3dm (12.8 MB)

24-0523 Maritime (26.8 KB)