The code falis on the line 98 so I do not know if the code you have listed is working.
ERROR
InfoPath cannot open the selected form because of an error in the form's code.
The following error occurred:
Expected ';'
File:script.js
Line:98
var listService As New WebList.Lists();
CODE for Line 98
var listService As New WebList.Lists();
I originally got the code in VBScript from here. http://www.infopathdev.com/forums/p/7997/29085.aspx#29085
I converted the VBScript code to JScript using this site http://slingfive.com/pages/code/scriptConverter/demo.html
ALL CODE
var listService As New WebList.Lists();
listService.Credentials = System.Net.CredentialCache.DefaultCredentials;
var viewstr As String = "{2EE4BCFF-5BC6-4B8E-A60F-5B733E89813A}";
var strBatch As String = "<Method ID='1' Cmd='New'>" + "<Field Name='ID'>New</Field>" + "<Field Name='Title'>"1"</Field>" + "<Field Name='CR%5FNumber'>"CR_0001"</Field>" + "<Field Name='Change%5Fx0020%5FRequest%5Fx0020%5FTitle'>KaverTitle</Field>" + "<Field Name='Description'>KaverDescription</Field>" + "</Method>";
var xmlDoc As New XmlDocument();
var elBatch As System.Xml.XmlElement = xmlDoc.CreateElement("Batch");
elBatch.InnerXml = strBatch;
var ndReturn As XmlNode = null;
Try;
ndReturn = listService.UpdateListItems(viewstr, elBatch);
Catch ex As System.Web.Services.Protocols.SoapException;
MessageBox.Show(ex.Detail.InnerXml);
Exit Sub;
End Try;