If you want a neat preconfigured chat with additional features, check out this modified version from Friendly Script Updater.
Thank you guys for providing it, and sorry that I couldn't check your version earlier. I didn't have enough spare time last year to do much in the onion world, so I couldn't audit your script in time. Things will be better again this year.
In case you prefer PHP over Perl, you might also want to check out LE Chat-PHP from Daniel Winzen.
Attention Tor Browser users!
The latest Tor Browser update (5.5) broke the frames and automatic refreshing, but that is not a problem of my code. Apparently NoScript or TorButton are going way overboard again, as has happened in the past already. Once I know a mitigation, I'll post it here. Otherwise let's hope the next Tor Browser update will fix it. There are more popular sites affected, so this bug should get enough attention from the developers.