Thought of this when talking to logan about something unrelated... Funny how you think of these things... Anyway....
You know when you add a task in adminCP? You choose a php file in the /sources/tasks/ folder? Well how about a query task... A simple task where you simply put a mySQL query into a box and that's your task. No need for a php file. Of cource only root admin would have the ability to edit/add these tasks, would save a lot of time when you want to automatically prune a certain table every once in a while.