Love the use of the keys. I am stealing this, as it is way cleaner then mine.
For mining on the side of a mountain:
Change:
waitfortarget 750
targettileoffset 0 0 0
pause 750
To:
waitfortarget 750
if direction == 0
targettileoffset 0 -1 0
elseif direction == 1
targettileoffset 1 -1 0
elseif direction == 2
targettileoffset 1 0 0
elseif direction == 3
targettileoffset 1 1 0
elseif direction == 4
targettileoffset 0 1 0
elseif direction == 5
targettileoffset -1 1 0
elseif direction == 6
targettileoffset -1 0 0
elseif direction == 7
targettileoffset -1 -1 0
endif
pause 750
This will change the macro from mining directly under your feet, to mining 1 space front of your character that it is facing. So if your facing north, it will mine north. West/west, etc.
I don't know if its possible to make it cleaner.