Doesn't look too bad. A few questions and suggestions:
- !NILP is implied y STRINGP.
- You might prefer to use fast_string_match.
- Is the recursive debugging a problem you've found to show up
unavoidably all the time, or are you just being cautious?
- You could turn your `debugging' into a Lisp var (call it
"inhibit-debug-on-message"), or you could let-bind debug-on-message to
nil around the call to the debugger.