Show a required textfield when user select only ups shipping service on checkout form
You could try to do this via #states property in form API.

More information about that can be found here:
How to make a form required with states?

Personally i only used it to hide/display form elements, but required/non-required should be possible as well.