Meanwhile, a hint on this undo subject for script/plugin writers:
I found out it to be more eficient in memory usage, if aplicable, of
course, to create a new image, disable undo in it (I cannont tell the
difference between freeze/disable so far), and do your script stuff
in there. When finalizing, copy your resulting drawable back to the
gimp_image_undo_group_start won't save your memory.
BTW, some of the included scheme scripts could benefit from this.
Gimp-developer mailing list