FeatureScript is a different beast. It actually runs as part of regeneration in Onshape. Standard features (extrude, loft...) are also defined in FeatureScript, so your custom features are the same first-class citizens with a interactive GUIs and stable updates to upstream changes. You can freely mix interactive CAD and custom code by adding standard features and custom features.
You can do that in FreeCAD. Performance is horribly slow in my experience, but maybe I'm doing something wrong.
https://wiki.freecad.org/Scripted_objects
https://wiki.freecad.org/Create_a_FeaturePython_object_part_...