Its a actually a good question and I for myself haven’t found a good solution either.
In my opinion it highly depends on the problem you are solving. Is it complex, does it depend on Rhino objects, does it involve manual tweaking etc…
I also distinguish between a “creational” and a “defensive” mindset. On “creational mode” I play with a lot of approaches to find out which approach solves it best. In there I won’t care much about structure and documentation, since this would disturb the creational phase. In “defensive mode” I do everything to make a script error proven, clearly structured and modular.
However I for myself prefer versioning by coping different versions/approaches into one single file.
That indeed doesn’t work with all, and usually I end up mixing it up, having multiple files with several versions inside. Not a perfect solution as well…
That is why I prefer code over graphical components. Direct coding is more difficult and slower, but it pays of in the end, especially regarding structuring,documentation and versioning. In the end its a mix of both worlds which suits best. At least in my opinion.
If you don’t know what this property does, you can always use ilspy.
Although this is semi-legal process, I believe its okay, if it servers a good purpose and does not include pure copy and pasting of intellectual property.