I found this blooper reel, transcribed below:
PICARD (gesturing to DATA): The admiral and I were worried about you.
(beat, either TROI stifles a laugh or SIRTIS briefly corpses, unclear which*)
DATA: Captain, I do not believe you have the authority to promote me to the rank of admiral.
(beat, several glances exchanged)
Everyone BREAKS CHARACTER and begins laughing.
SPINER: Good take. Good take!
* It might have been clearer if the video had not frozen for most of this beat.
The scene is obviously taken from the closing minutes of episode 2x22 "Shades of Gray." What is less clear to me is whether Data's line (in bold) was in the original script, or if Stewart messed up and Spiner ad-libbed a decent response.
Both lines do appear in the final episode, and are immediately preceded by Riker joking that he thinks he's Picard, so it's entirely plausible that this was planned from the beginning. But as I recall, Riker's line is delivered in a close up, so it could have been recorded afterwards to make the joke work.
Was this an ad-lib? If not, what were they laughing at?