You can check if the database is compiled programmatically using the Compiled Application command.
In some cases, you may need to run a debug code only if your database is running in interpreted mode. To do this, you can execute code similar to the code below:
If (Not(Compiled application))
`run debug code