Test in script on running in debug mode

I make my first AppleScript and read the inbox of the mail app.
Because of the problems with external bugging (see External debugging doesn't work) I use when I test the script the valuable contribution of Shane Stanley.
Now I wonder if it is also possible via a compiler directive to exclude this statements when compiling in debug mode.
It would also be a solution to test in the script if it is running in debug mode.
Does anyone know if this is possible or is there another solution?

AppleScript doesn’t support compiler directives, so there’s no simple universal solution. However, you can use something like this:

if id of current application is "com.latenightsw.ScriptDebugger6" then
-- debugging

Thanks Shane, again a valuable solution!