There is one major problem that I see with the code you posted. You have two if statements that are working to set the $_SESSION["flat_shipping"] variable. Since the first one is only checking if the $_POST["UPS_Service"] is set it will always set the session variable when you first come to this page. This is no good since the check for running the UPS shipping server behavior relies on this variable having a value, if you give this variable a value when the user has selected a UPS shipping option the shipping will not trigger and nothing will show in the cart. In the code you posted if you remove the first if statement that is setting the $_SESSION["flat_shipping"] variable then the trigger for the UPS shipping should work for you.
The code to get rid of in the example you posted is this:
if((((isset($_POST["UPS_Service"]))?$_POST["UPS_Service"]:"") != "")) {
$_SESSION["flat_shipping"] = "".((isset($_POST["UPS_Service"]))?$_POST["UPS_Service"]:"") ."";
}
The other valid code appears just below this and should work for you, let us know what you experience.