in the Authentication for PayPal Express Checkout server behavior, select the Button PayPalXpr pressed trigger.
this will write the trigger code as:
if (isset($_POST["PayPalXpr_x"])) {
which wont get overwritten
it's not needed to check for both the request method and the button being set, the only way the button will be set is if the request method is POST.