Print Parameters in Dynamic SQL
One way to get this done is probably something you have already done, and that is to replace your line:

if @DebugMode=1 print @SQL


with

if @DebugMode=1 print @SQL + ' ' + convert(nvarchar(max), @Foobar)


And you would have to do it this way for all your variables, you will need to convert them manually to avoid conversion errors. 

You could also use RAISERROR in a similar fashion:

if @DebugMode=1 RAISERROR (N'We used a value of %d for @Foobar', 10, 1, @Foobar)


HTH