That could be a bit tricky in Mach3, as you can't reconfigure limit switches on the fly.

My initial thought, is add an extra relay controlled by an output, that overrides/bypasses the Z upper limit switch.

Then in your M6 macro, have it activate the Z upper limit override output/relay, then command a Z move until the tool change switch is triggered, change the tool, then move back down far enough so the Z-limit switch is cleared, then deactivate the limit override output.

A safer option might be command a G53 g-code move up, which would avoid running into a mechanical limit, if the limit switch was to fail. The distance the axis has to move should not change, so using a specified move should work well.

Once you have that working via your M6 macro, adding a button to control it should be relatively easy. In fact thinking about, you'll probably want your M6 macro to pause and wait for a manual input anyway, otherwise it'll drop the tool whenever it reaches an M6.