Hi again Saurabh, for some reason the scheduled job did nothing when I ran it, I have tested it in the test environment, I have used the following  

var gr = new GlideRecord(TableName);
gr.addEncodedQuery(state, 6);

then I right click next to the scheduled job name then Copy Sys_ID.

var scheduleID = gs.getProperty('scheduledJobSys_ID')

and for gr.state = 3; I have used the same value since I have it the same, please let me know if there is anything else I need to do to make it work. Thanks