This is very easy to do, and doesn't even require a Macro Operation.
Step 1. You will want to change the existing M6 function to @M6. Adding the @ symbol allows the function to work properly, but the M6 will not be output. You will do this in the Function Definition dialog.
Step 2. Now go add an M6 to the Output after tool change: box for both the First Tool and Other Tools. You will do this in the Tool Change dialog. Notice that Auto tool change function: already show your @M6 function code.