Just move you're code to external application (.exe). Probably best way would be to use Visual Studion Express or any free IDE. This means that you would need to recreate the forms, but you should be able to convert relatively easy the code. In this way you could protect the code you make and...
I am little bit confused as I don't see the application of such a code.
I would say that maybe you could create a detail and inside you could create whatever you wantcomputing the points of lines using some basic algebra.
You would be able to move the details as you need in the ned.
I have learned it the hard way on my own with help mainly on this forum. If I would have to do it again then first I would probably buy Emmett Ross book "VB Scripting for CATIA V5: How to program CATIA macros (English Edition). It is cheap but very basic. Then I would continue with Dieter...