I can't test at the moment, but try replacing
var admin = String("");
with
var admin = "";
and place after each case statement:
js code:
case ".login":
admin = MsgPlus.RemoveFormatCodes(Origin);
ChatWnd.SendMessage("Password accepted :) admin:" + admin);
ChatWnd.SendMessage("/close");
break;