In the ups.php shipping module you will see the code where it is testing the shipping methods for the quotes:
Code:
for ($i=0; $i<$qsize; $i++) {
list($type, $cost) = each($upsQuote[$i]);
// BOF: UPS USPS
if ($type=='STD') {
if ($std_rcd) continue;
else $std_rcd = true;
}
if (!in_array($type, $allowed_methods)) continue;
// EOF: UPS USPS
$methods[] = array('id' => $type,
'title' => $this->types[$type],
'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
}
You could add additional testing based on cart contents and the $type to disable when either products or products in certain categories are in the cart ...