It could be done completely in php and jquery
Yes, it *can*, but I strongly advise against it, because it will flatten any server once it gets remotely busy, no matter how you have it configured.
Option 1: COMET style, long running HTTP kept-alive polls, held open until there's an update... which is efficient right up until you consider that Apache will force a new PHP threadprocess for each connection, which means you're talking a persistent weight of 20MB or so per connection, and it doesn't take many connections before you either hit the oomkiller, or you've exhausted the memory pool for genuine connections.
If you want to go down the road of nginx+PHP-FPM at this point, be aware that most hosts don't support that yet, because it's fundamentally different to how they're set up. Yes, it will cope with thousands of edge connected HTTP connections driven by event handling, and use little memory in handling it, but you lose the ability to properly authenticate to it.
Option 2: AJAX style, regular polling. Let's see, even with 20 users polling every 10 seconds (which is a low number of users and much slower than most of the existing AJAX chat solutions), you still have to run the gamut of Wedge startup in order to authenticate the user, which means you're pulling an awful lot into memory to achieve it and still be efficient.
Before I go any further, let me make it known that on one site I run, I *have* such a system; I wrote it from scratch as a plugin to SimpleDesk (which means it installs without any file edits of its own whatsoever). It's AJAX style, and it's very, very carefully written to be incredibly efficient; it even uses a specially modified version of the SMF API that I wrote for 2.0 to make authentication an order of magnitude cheaper than SSI.php.
IOW, been there, seen it, done it, and it would flatten most low end hosts, even with the lightweight solution I have.