Thank you for your suggestion Eric, sounds like a great feature for us to look in to.
In the meantime we have a few options for you that might help you a little to work around this:
1. Manually deactivate the Chat within the widget after the opening hours.
3. If you don't want to provide website visitors the ability to chat outside the opening hours, you can choose to disable the feature "Show always as available". When this feature is disabled and there are no agents online, the chat will be transformed into a contact form.
BTW for people that are looking for a working script: