Wrap code into functions to sinplify usage with AkelPad.Include()
Move check for hMainWnd into handleArgs(), for AkelPad.Include()

Example:
if(!AkelPad.Include("..\\jsBeautifier.js"))
	WScript.Quit();

var _beautifyOrig = beautify;
beautify = function(source, syntax) {
	return _beautifyOrig.apply(this, arguments)
		.replace(/<(p|subtitle)>\n[ \t]*/ig, "<$1>")
		.replace(/\n[ \t]*<\/(p|subtitle)>/ig, "</$1>");
};

handleArgs();