Corrected entry: Scotty and Geordi use the shields of the Jenolan to 'jam the doors' of the Dyson sphere so the Enterprise can escape. They get beamed out an instant before the ship is destroyed. But in numerous episodes before and after this one, it is impossible to beam through shields - they would have died along with the Jenolan.
Corrected entry: After Geordie and Riker get Scotty out of the transporter, Riker introduces himself, including the ship's name. As soon as Scotty hears him say "Enterprise", he says "The Enterprise, I should have known, I'll bet Jim Kirk himself pulled the old girl out of mothballs to come looking for me". But Scotty was there when Kirk was "killed" by the Nexus in the beginning of Star Trek: Generations. That took place before this episode. Since Scotty was there when Kirk "died", how could be bet that it was Kirk who came looking for him?
Correction: This is a mistake, but more of a mistake on the movie Generations, then the series. This episode was written and aired (1992) before the movie Generations (1994). At the time the episode was written and aired, the events of the Generations had never happened (so what Scotty said could have been true, at that time).
Correction: They beam out in the time between the shields failing and the Jenolan being destroyed. This is not any kind of stretch. Many times in Trek a ship has performed a transport in a split second when shields are lowered.
Grumpy Scot