If it were a snake, it would have bitten you.

Have a look in the LuaExamples\Toolchanger directory of your Mach 4 installation. There you will find and assortment of tool changer M6 macros. One of them will do exactly (or close to) what you want. And if it doesn't, then what you are wanting to do doesn't fit the handful of basic operations. Luckily, we gave you the ability to do anything you want with a tool changer. But at that point, you will have to make it do your bidding with a small amount of LUA self education. It isn't rocket science. And the forum is here for help if you need it.
MOST of the time when people are having to write code it is because they DO want something special. Or they THINK they need something special and just don't know any better because the first time they thought about a CNC machine was the week before when they ordered it. I'm speaking from experience because yeah... I used to be that guy that didn't know any better. Everybody starts at square one.
95% of the time, people just buy a machine that already had Mach installed and configured. This forum makes up the 5% that don't do that. This group of people either retrofitted an existing machine, or built their own. Like it or not, they are now the machine control integrator. In both cases, each person has (knowingly or not) accepted the challenge of having to do more than the 95% did.
If you don't have an auto changer, have you thought about not even messing with M6 codes in a program? I write (or generate) a G code file per tool and just run them separately. Way less hassle, IMHO.
Steve