You can use the function win.close() to close a window. win is the object of the desired window.
Use parent. or f.i. top. to reach WinLIKE, because this script is inside of the content and does not know anything about WinLIKE.

var winNr=parent.WinLIKE.searchwindow('scriptWindow2');
parent.WinLIKE.windows[winNr].close()