Dynamo script to correct architecture model

arch.dyn (77.9 KB)
i have made dynamo scripts to fix the length and height of architectural walls but there are some errors.
can someone correct the script? or show another method to correct architectural model.
i want proper architectural model to draw rooms and spaces so that i can import to IESVE for thermal calculations.

thankyou
arch1.dyn (77.0 KB)