As is well known GRBL and TinyG supports no macro programming such as e.g. LinuxCNC.
But in my new program version V3.2 I've added a library (https://github.com/NRSoft/GSharp), which allows the using of G-code with variables, conditions, loops and subroutines.
See in the attached video how to use GrblGru as development environment to create and debug G-code.
Please note, that the real possibilities of the g# maro language are much more powerful.
For details see e.g. http://linuxcnc.org/docs/html/gcode/overview.html
Free download GrblGru V3.2 from my dropbox: https://goo.gl/quFpdZ