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 ...