Can I limit a process to a certain amount of time / CPU cycles?

We have a script which runs on our web servers, triggered by customer action, which initiates a unix process to generate some cache files. Because this process acts upon files supplied by our customer, it sometimes misbehaves, running so long that the PHP process which spawns it times out or using so much CPU time that a sysadmin will kill it.

Which run dialog

I just switched from the standard Gnome window manager to Openbox (still running inside Gnome) and like it a lot. However, now I need a new run dialog, e.g. the thing popping up when hitting Alt+F2 in Gnome. I see in the Openbox wiki, I can use the one from gnome with gnome-panel-control --run-dialog but maybe some one can recommend a better program for this?