2. copy the content of the generated text file to the script section of your new QVW
3. reload the document
There you go, the variables will be created in your new document. Maybe you'll need to do some adjustments if your variables have complex expressions with single and double quotation marks, this can confuse QV when you put it in the script.
(it is quite simple, I hope I understood right your requirement.... )