Hi @prasath.t, can you use %A to get the weekday name and check for this in your first if statement?
You may also be interested in the future 8.1.6 release, as this contains cron-based scripting event.
Also, slight note on using sleep in scripts. It can be considered bad practice in locking the thread with sleep (see here for further information). Although, in your case it’s a Gateway scoped script, so might not be so much of an issue. Just a minor observation