I think it's not in any script.
In the windows version there is an executable named "cb_console_runner.exe" in codeblocks installation directory that handles execution of the programs.
If you type "C:\CodeBlocks\cb_console_runner.exe calc.exe" it runs calc.exe and when you close the application it prints the message you mention and pauses the console until you press a key. Replace "C:\CodeBlocks" with your installation directory and calc.exe with your executable
Maybe you could make your own "cb_console_runner.exe" and replace it, or search in the source of codeblocks.