Duplicate a form

Duplicate a form

Is there a way to duplicate a form without having to recreate a similar form? I have followed the instructions to do so via script, however, I am unsure where the code snippet is to be copied to.