CQ offers you 4 different type of WCM modes: edit, preview, design and disabled. The first three are actually different modes while the forth is when none of them is available and, at the end, always represent the situation on the publish site.
This script should help you and it should be possible to drop it as part of your clientlibs and ready to be used for he use case.
Something very simple that hopefully will help your daily life. 🙂