Requires the TaskBomb app, available free in the Android Market:
See the website for tons of info, help, and tutorials:
TaskBomb is an automation app (sometimes called "task scheduler", "job scheduler", "batch processor", etc.) that allows you to schedule apps and actions to automatically run. It's similar in function to the cron command on Linux and somewhat like an alarm clock (you can set alarms and snooze actions). TaskBomb aims to be small and simple, and leverage the power of the apps you have on your phone.
One of TaskBomb's greatest assets is its unique and flexible scheduling system that allows you to create modular, reusable schedules that can be run at any time, attached to alarms, or added to other schedules.
This add-on is basically a little app, but you don't run the app itself. Once installed, go into TaskBomb and you'll find "Select script" as an option in the "Data" field when you define a task.