Scotty's only contribution is using his ship to hold the doors of the Dyson Sphere open so that the Enterprise can escape - something any Enterprise-D crew could have done with a shuttle.
He starts out eager to help, only to be slapped around by the entire TNG crew. After retreating into a puddle of nostalgia, Scotty realizes that he has indeed outlived his usefulness, and needs to get out of everyone's way!
It's as if TNG were still fighting for ToS fans all the way into season 6, and decided the only way to do it was to make all ToS fans angry.
He starts out eager to help, only to be slapped around by the entire TNG crew. After retreating into a puddle of nostalgia, Scotty realizes that he has indeed outlived his usefulness, and needs to get out of everyone's way!
It's as if TNG were still fighting for ToS fans all the way into season 6, and decided the only way to do it was to make all ToS fans angry.