So just to confirm - you're doing
Ticket 1: BOS-PHL
Ticket 2: PHL-ORH-PHL
Ticket 3: PHL-DEN//DEN-BOS
Correct?
If so you have a few options:
1. Don't pick up your bags from BOS-PHL, then pick them up when you come back from PHL and check them with UA. The cut-off is T-45 mins.
2. Check bags with UA early - they should let you do that as they have numerous flights ex-PHL. You may want to make sure you can do that before picking up your luggage in PHL.
3. Don't check lugagge :P