It does work... In fact I've edited your script slightly for my own purposes. I've managed to trim it to this:
code:
function OnEvent_MenuClicked(sMenuId, nLocation, ChatWnd){
if(sMenuId=="debugger"){
Debug.DebuggingWindowVisible = !Debug.DebuggingWindowVisible;
}
}
I moved the menu code to the ScriptInfo file. I took out the nLocation = 2 check as I want it in chat windows too. For most people that will be using the script, checking the registry to see if debugging is enabled will not be needed.