Take a look at this:
http://www.kotalampi.com/scripts/watchtokens
It is watching your system load & available io tokens and will stop and start services if they go too low/high and restart when systems have returned to normal.
You can modify it for your purposes as follows:
Put your start/stop commands to these files:
$startfile ="/etc/rc.d/start.sh";
$stopfile ="/etc/rc.d/stop.sh";
When to stop services (when load/tokens is at these levels):
$maxload = 3.0;
$l = 0.2; # <20% of max io_tokens
When to restart services (when load/tokens is back at these levels):
$minload = 1.1;
$u = 0.5; # >50% of max io_tokens
Cheers,
Risto