How to determine the maximum posible size of a inside shell before extruding the external surface?

Im my opinion this can be automated.

First you need to get the anatomical axis of the long bone. Look at this code to get an idea of something you could improve:

You can see my post about finding the anatomical axis also:
https://discourse.slicer.org/t/approximate-anatomical-axis-curve-of-long-bone/

Please let me know if you achieve it

Hope it helps

Mauro