If you pass 0 as an argument to delay(), the script will not continue:
script 1 OPEN
{
delay(3 * 35);
print(s: "First run .... ");
delay(2 * 35);
ACS_Execute(2,0,90,0,0);
scriptwait(2);
delay(2 * 35);
print(s: "second run .... delay bug .. waiting forever");
delay(2 * 35);
ACS_Execute(2,0,0,0,0); // BUG!!!!!! change it to 2,0,1,0,0 and everything is okay
scriptwait(2);
Exit_normal(0);
}
script 2 (int dtime)
{
Print(s: "you passed ",d:dtime,s:" to this script");
Delay(dtime);
Print(s: "OK");
}