This script is not perfect so far,
I had to make some choice, in order to have something generical as possible.
I prefered to leave a distance between the box wall and the legs, first because it's calculated from the hole leg center
not from the PCB border.
second, because of the foot filet.
I wish to improve the ultimate box maker, but honestly it take a time, that actually I don't really have.
sorry for the moment to not really help you.
Thanks a lot for your appreciation, it's very pleasant to read.
Have a nice day.