Form Duplication on the Fly

Form Duplication on the Fly

Can I duplicate a form using only deluge script or am I forced to manually navigate the creator menus to do so? I want to use a sinlge form as a template and then duplicate it on the fly with code and then populate the fields with data from other records. How is this done? Can it be done?