One option is to run script every time at runtime, but skip its execution depending on server name. This will work if there is strict environment naming convention.
Inside DebugData.sql put the guard
-- here the condition is LIKE `DEV`, it could be NOT LIKE 'PROD'
IF @@SERVERNAME LIKE 'DEV%'
BEGIN
... Here goes content of the script
END
Option two:
Instead of using single hardcoded value, prepare version for each configuration:
:r .\DebugData.sql
=>
:r ."\"$(Config)Data.sql
Now you need two files:
DebugData.sql -- actual script
ReleasaeData.sql -- empty file
Depending of configuaration proile one of the files will be choosen. For release it is be the empty one, so no actual code will be executed.