defining a macro with variables
You can't. Variables and macros are completely different concepts and handled by completely different parts of the compiler toolchain.
Instead you will need to build your string up into a char array (or whatever format the _user_gcode_exec() function accepts) with the likes of sprintf.