I've done an alternative way to code this using get/set chunks that doesn't generate undo. But it is not CPU friendly, and it generates audio glitches if used when playing. Sometimes I need to set preset for 10 or 20 tracks at once. so I have the option to use reaper.TrackFX_SetPreset which generates 20 undo entries, or use chunks and deal with audio glitches.
If at least I could group all 20 undo entries in one undo block it would be better.