It should be possible to create a Program Document and have them followed up by another Prgram Document when the task is completed.
E.g. maybe you want to stop some tasks when DBMT is active:
Program Document 1: server - c "tell http quit" at 00:57
DBMT starts at 01:00 untill maximum 03:00
Now you want the HTTP task to start again as soon as DBMT is done
Program Document 1: server - c "tell amgr quit" at 00:57
Program Document 2: compact -B systemdbs.ind at 01:00 (or as soon as amgr has been quit)
Program Document 3: server - c "load amgr" as soon as compacting is done.