Asciimathml needs the script tag for the actual javascript tag in correct place (header of that frame/window that renders math).
I can't check the code of chat module right now but I will send you more info next week - it's probably a one line add to one of those chat files...