I think the best way to go about this would to use a monitoring system which looked at the replication MBeans. If this isn't an option, than yes, implementing a listener could be an option.
But it is likely you'll need monitoring for more than just this one thing.
See if this help
Package with more code can be found here http://www.wemblog.com/2012/07/how-to-clear-replication-queue-in-cq.html
If a single replication action fails every now and then and the next attempt is succesfull, then it's not a problem. Such temporary problems can have many sources, and it's often not worth to analyze them.
As Justin suggested, you should rather monitor the replication mbeans, especially the size of the replication queue.