You could get the script to check for a registry key, and if it doesn't exist, it should create one because it is the first launch.
js code:
// add to the top
var shell = new ActiveXObject("WScript.Shell");
// ...
function OnEvent_Initialize(MessengerStart)
{
try {
// value exists, already running, exit now
shell.RegRead(MsgPlus.ScriptRegPath + "\\IsRunning");
return false;
} catch (error) {
// not yet running, make a registry value, continue
shell.RegWrite(MsgPlus.ScriptRegPath + "\\IsRunning", "1");
}
// Check if there's anything to be done
if(emailList.length > 0) {
MsgPlus.AddTimer('windowDelayer', delayOpenWnd);
} else {
// finished, delete the registry key
shell.RegDelete(MsgPlus.ScriptRegPath + "\\IsRunning");
}
}
// ...