You can do all the message recognition work up-front, before requesting the wake lock. If the message type is unset/unrecognized, you can just bail early (maybe use `console.error` in that case, because presumably a developer is trying to add new functionality). I think this is a worthwhile refactoring because:

- no need for a `success` flag
- one less level of indentation
- only the work that requires a wake lock is defined inside the `safeWakeLock` callback