i did a Naked Shoutbox @ ubbdev that can still be improved upon. you might want to check over there, at least for a working example of an external version.
as for your example, um... whoa.. it's hard to start on where you need to change things..
Linky Poo -- to Naked (external) shoutbox.