You are very close, you just need to update these two triggers to check for the specific value of the posted element, like this:
if ((((isset($_POST["shipping_type"]))?$_POST["shipping_type"]:"") == "UPS")) {
For the second server behavior you would update to be like this:
if ((((isset($_POST["shipping_type"]))?$_POST["shipping_type"]:"") != "UPS")) {
This way it will check if the user selected UPS, and if not the USPS shipping quote will be used.