Please don't take this as discouragement to learning Macro B. It's a great thing to learn. Wish I'd given it more time over the years. But many times I see it being used to do things that are done much simpler in basic G code ways.
Continue on with your quest, and sorry I can't help you with your current problem, other then suggesting that at some point, study up on G52. (Local Coordinate System) Whether it completely matches what you're after is beyond me, but from your thread title, I think they're close enough for study.