With Nimoy it was always something more that had to coax him back as Spock throughout the 80s - he wasn't going to be in Star Trek: Phase II but they signed him on for TMP; he got killed off in STII but because Nimoy directed 3 and 4 so he was revived; Shatner directed trek5 and Nimoy was involved in the story for 6 [filmed April to July 91]. Unification was shot in September 91, presumably Leonard did it to promote the movie. He agreed to JJ's film 19 years later as he felt Spock gave a decent contribution to the story. The Into Darkness cameo was presumably out of courtesy.
Thinking back to 1994, Shatner probably thought Generations would be a nice handover to TNG. That was the point, the handover from Kirk to Picard. In his 60s her probably thought there wouldn't be another opportunity to play the part again. ST6 I agree was a great send off and Roddenberry's final Trek project, most of the original 7 have been back since in one way or another! Maybe Shatner didn't anticipate living into his 80s? Times change.
He turns 86 this month - I do admit seeing Shatner looking visibly older in the Starfleet Academy videogame and the Oscars sketch is a bit weird. He is involved in so many projects now on TV, film, book etc, a very prominent celebrity, and he still travels the world for conventions