A new tool is available to quickly help you test scripts out of SCOM management packs.
https://www.scom2k7.com/quickly-fix-scom-scripts-from-exported-management-packs-with-transform-tool/
This will remove or “unescape” the special characters that are not allowed in XML, back to the original characters so the script can be run, quick and simple.