olark('api.box.onShow', function() {
	// Your callback function
});

Notes

Whenever the chatbox is shown (unhidden), the given callback function will be triggered.

Screenshot of API call on show

Update visitor status when chat box visible

If you have chosen to have your chatbox hidden by default, you can indicate in your buddy list that a visitor can now see the chatbox. This means they might be about to send a message:

olark('api.box.onShow', function() {
    olark('api.chat.updateVisitorNickname', {
        snippet: "is visible"
    });
});