Also, are the SetOption properties supposed to work?

 Code:
SetOption("WrapAtEOL","On")
Produces "Exception has been thrown by the target of an invocation.
Index and length must refer to a location within the string.
Parameter name: length
on script line:3 char position:1
Hit Enter to quit"

And the @ScriptDir might have a problem after all. It is cutting off after about half the path.