In general there are already some chat plugins available in the market. Ref:
https://themeisle.com/blog/best-live-chat-plugins-wordpress/ or search on google by typing "wordpress chat plugin".
Instead of developing a script from the scratch, if I were you then I would use a ready-made one first. I would the customize the existing one to meet my needs. Hope it helps.
Good luck
These unfortunately have a monthly fee. Here's an example: Price: premium plans start at $16/month. I'm pretty sure that people would prefer a one-time payment. That doesn't mean that some of them aren't much cheaper and better than what you or me could develop, so I think they might be worth it if you're running a business.
I’d highly recommend you add in a tab to use emojis in the chat box of your casino. Emojis are a great way for chatters to convey emotion, and I like to use them whenever possible, especially when I’m trying to do something for entertainment like in gambling. I don’t use the chat box of casinos often, but it’s always interesting to speak to other people online and talk about their experiences on the site.
Not a bad idea, since the most popular sites like PD, fortunejack, and Stake, are using the same plain and boring chat.
OP, take a look at yolodice chat. It allows you to see small avatars of people next to their names and they allow you to quickly check their stats. You can also see the person's level as stare next to their name.
Don't waste your time though. It would be better if you contacted the casinos first and make sure they are willing to pay for an upgrade.