I guess you have two choices you could keep a message count then send when it reaches a threshold i.e. 5 messages unseen. Or you could do it based on time, so if the message is unseen for x minutes then send email.
The first one could be done by keeping the count in the database then when the 5th message is sent you trigger a workflow that sends an email. For the time based one you can create a scheduled api call for 5 mins in the future (current date/time + 5mins) make it only run if the message is still unseen.