Can dialogs be dynamic?

I have followed along and created a dialog, but now I am trying to figure out how to put the html into the script-addin.
according to https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Resources.htm

I can just add the code to the botton of the script

Everything before the line ==SCRIPT RESOURCES is considered part of the script code, and everything after it is the XML-formatted resources.

This causes an error and doesn't work.
error

I have am currently trying this option:
Script resources can be loaded from an external file, or a raw XML string, using the Script.LoadResources** method.

	Script.LoadResources  ('
		<resources>
		<resource name="SelectDestination" type="dialog">
			<dialog fontsize="8" height="120" lang="english" resize="yes" width="550">
				<control halign="left" height="8" name="static1" title="Source Folder:" type="static" valign="top" width="50" x="18" y="18" />
				<control height="30" name="group1" title="Source" type="group" width="540" x="5" y="6" />
				<control halign="left" height="8" name="SourceFolder" title="sourcefolder" type="static" valign="top" width="440" x="72" y="18" />
				<control height="24" name="group2" title="Search Field" type="group" width="540" x="5" y="36" />
				<control halign="left" height="12" name="search" title="search" type="edit" width="276" x="137" y="42" />
				<control height="40" name="combo" type="combo" width="540" x="5" y="66" />
				<control close="1" height="14" name="button1" title="Move Selected" type="button" width="61" x="161" y="90" />
				<control close="2" height="14" name="button2" title="Move Source Folder" type="button" width="73" x="232" y="90" />
				<control close="0" default="yes" height="14" name="button3" title="cancel" type="button" width="50" x="317" y="90" />
			</dialog>
		</resource>
</resources>

');

Something is incorrect about this, but I have no idea what I did wrong.

So the last thing to try I guess is

can be loaded from an external file

Seems like this would take more over head, and I will have a separate file that could get "lost". I would really prefer to keep the code in the script if possible.