You're trying to write to the registry, therefore you need to use
MsgPlus.ScriptRegPath.
As for arrays, you define them just as you would for JScript.
jscript code:
var arr1 = new Array(); // new empty array
var arr2 = new Array("Item 1", "Item 2"); // new array with items
var arr3 = []; // shorthand version of arr1
var arr4 = ["Item 1", "Item 2"]; // shorthand version of arr2
var arr5 = [["Sub-item 1", "Sub-item 2"], ["Sub-item 1", "Sub-item 2"]]; // multi-dimension array