I believe it would be not a bad idea to handle period script runs and certain event based actions using Quartz3: https://www.quartz-scheduler.net/