I had this happen to me a couple of times throughout my last trip. Most of the time a ride would close, and I would just wait for it to be fixed, I was never so fortunate as to have a ride like Star Wars break, allowing me another free ride on Tower of Terror or Toy Story instead of bypassing the 10 minute line of star wars.
I did however get very lucky twice on my trip with rides breaking down for special circumstances.
1. I was riding the Mine Train (second day of official operation), and it was the last ride of the night, went in line right before park closing, and probably had only 50-100 people behind me (obviously this was a common strategy for the brand new ride). I got on the ride with my dad, and we rode the entire way through, only to have the ride break down right in front of the cottage at the end, so the only part of the ride we "missed" experiencing was the final move into the station. We only waited 2 minutes to be manually taken off, got a close up look at the cottage and witch, and received a fast pass that was good the following day ANYWHERE. I wound up using both my and my dad's passes for the mine train, but had I wanted, I could have used one to visit Anna and Else, who of course a year ago were still hosting 3 hour long lines. Plus BONUS, I got a pass from another guy on my train who was leaving the next day and had no use for it. The following day I had 3 rides on the mine train no wait, in the first week of operation.
2. I had a fast pass for space mountain I was using, but I did not get far in the line before it stopped moving and the lights came on. Everyone was directed to an exit, and handed out passes good for any Magic Kingdom Ride (excluding the Mine Train and the Anna/Elsa meet and greet), meanwhile though, since I had just gotten into the fast pass line (or the where the line formed at the control tower area), I had not yet reached the fast pass scanner that confirms that you are on the ride (I only scanned the front one which allows me into the line), so as far as the MyMagic+ system was concerned I had not arrived for my fast pass yet, and I promptly received an email with a list of thrill rides I could replace the fast pass with. With all of that done, I headed to book my 4th fast pass (since the original space mountain one became used due to the breakdown), and rebooked Space mountain for an hour later (since I was a single rider, there were a lot left), and used my two freebie passes at Splash and Big Thunder. Space Mountain was still broken when my FP + time came up, so I received another email for another freebie, booked another ride (I think I chose buzz lightyear 30 minutes away to spare me a walk), and then went to check on Space Mountain. Right as I walked up, the staff members told me it just reopened, and I went in with a 3 minute wait, came out to use my broken ride FP for a second go round (line now up to an hour or so), and then went on to buzz lightyear, and the rest of my night (kind of a blur after that, probably people watched for a while and ate some food). I guess to sum everything up... Luckiest Trip Ever.