The modify panel tends to update when
iterating over a collection of nodes, like adding modifiers etc. This can slow the script down considerably, so switching to create panel can help there, there are a some other statements too that can help, you can look them up in the help, disableSceneRedraw, with redraw off etc. If you want to make a button, but don't know how to create a macroscript, ...