Oh I see. Depending on how complex your parameters you might be able to do using a workflow. Otherwise it would be a script
You can setup free shipping items so if you select those as the shipping method it would be no shipping charges (like setup a shipping item of UPS ground - free and UPS Ground). You can also add shipping rules that adjusts rates like Quantity or Weight based rules. Not sure if that would cover it