Is it possible to replace a simple widget controller with Groovy class file controller ?
<widget-definition ... id="com.mywidget">
...
<controller class="MyCustomController.groovy"/>
</widget-definition>
You can still decalre your class, and call a groovy script that you can store in database, or in the classpaht, using ScriptingLanguagesService class.
Or, create a cronjob with a scripting job, then you can run the cronjob from your class that will be used as a controller.
Please refere to links below for technical details. https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/6.6.0.0/en-US/8bec04a386691014938a9996a977d07f.html
Play with those options to find a good way that fits you, I could not find any OOTB way to do what you asked for.