"script Not Responding"... Not

Your own script?

It’s not something you can turn off. Anything that takes too long should be re-coded appropriately.

Rewrite the code and use something like ProcessSlicer or OneShotIdle.