I posted this over in the machinetoolhelp forum for a different user name of "cncguy" but considering it is the exact same question I am going to post it here as well incase it helps anyone else.
Is it safe to ass u me that you are cncguy as well?? A lot of the same questions from 2 different users in 2 different forums.
I am not up on the Mazak programming lingo so I will not be able to help you with code. However a macro will not give you what you want. If you wanted to do shortest distance without the parameter change then you would have to program a B- or B+ from the position you are at or from B0.
Now the machines that I am familiar with will have a parameter setting for this which has already been pointed out to you. I would recommend finding the parameter manual online or by other means and simply setting the parameter and no additional programing is required. I have done this for all the rotary axis machines that I have setup.
In Fanuc controls it is determined by bit RINC which will move the rotary axis in the direction that is the least movement. I have also found setting bit RDAx for the rollover function. This way the control will not go past 360deg. Once it reaches 360 it will roll back over to 0 instead of adding to the 360deg.