I am also able to execute the script from a global scope .

Infact, this was working and the only change which I did was creating a dedicated event processor for processing the next set of events which gets created by the 'scheduled job' which this script is suppose to create.