Disable / Enable Sync While AppleScript is Running?

I modified the Templates AppleScript by Chris Sauve to disable sync at the start and re-enable it at the end. This change reduced the run time of one template from five minutes to two seconds!

Well, I can’t remember the change (code) and I lost the modified script (don’t ask). Does anybody know how to do it? I searched the OmniFocus dictionary but could not find anything that I recognized as the solution.