Protect your schedule, including the empty time.
Make an appointment with yourself on some of the "empty" time.
If someone invites you to something you don't want to go to, tell them you have a commitment.
If you do want to go, tell them you need to reschedule something on your calendar and get back to them later. Let them see your time is valuable.