i don't think any PHP/MYSQL script can cope with 300 concurrent users on a shared host...it's just too much.
If you have 300 users, then i suggest you go with either a JAVA chat application or ,even better, a hosting company that is managing all the server load for you, something like
http://www.123flashchat.com/ ... be prepared to spend some money... this stuff is expensive.