This may be a bit harder to implement than it might seem. The grbl code uses all but one pin, so you would have to change that in the library. So I checked out the the code for the shield, and under the cpu_map tab it defines the pins. I would first try setting the unused pins to arbitrary values to enable the pins previously used by the code. For instance, if you are not using the Zed axis, try changing
#define Z_STEP_BIT 4 // Uno Digital Pin 4
to something like
`#define Z_STEP_BIT 0`.
This should clear up pin 4 to be setup as a input/output in your main sketch. Another pin definition associated with the Zed axis is
`#define Z_DIRECTION_BIT 7 // Uno Digital Pin 7`
Clear that one out, and you should be able to use pin 7 as an I/O.
I haven't personally tested the code so give it a try. Also just a heads up will probably run into errors while trying to use the MPU6050 library as well as grbl library, the grbl library is a LOT of code (I didn't spend enough time trying to compile so I don't know how much space it's actually using, but it's a lot). You might also run into timer errors as both libraries most likely reconfigure timers to work with each.
I hope this was a bit helpful!
EDIT:
I realized I didn't specify how to exactly free up A5. It has been assigned to the probe in the cpu_map.