I don't think you can do exactly what you want with just one button, because the "triplet" and "dotted" actions are not toggles (and they shouldn't be, since you probably don't want both to be on at once).
You can have separate buttons, set to the following MIDI Editor actions:
Code:
Grid: Set grid type to triplet
Grid: Set grid type to straight
Grid: Set grid type to dotted
Grid: Set grid type to swing
If you're adventurous, you can set up the following two custom actions.
With successive clicks, this one turns the grid from dotted to straight to triplet (you can keep going beyond that, but the numbers start to get weird):
Code:
Grid: Multiply grid size by 2
Grid: Multiply grid size by 1/3
And this one does the opposite (turns the grid from triplet to straight to dotted):
Code:
Grid: Multiply grid size by 3
Grid: Multiply grid size by 1/2
I set those two actions up with shortcut keys, and most of the time, I just need to run one action, and then the opposite action to reset the grid.