I love IV and it's definitely the Trek movie that cheers me up the most, but Undiscovered Country is the best TOS movie. Great cast, huge canon implications, great sendoff.
Nichelle Nichols was right that it was utter bullshit that her character didn't know Klingon after decades of experience on a ship that regularly dealt with Klingon-related diplomatic crises, but this scene is still a guilty pleasure. Nichelle's face at the end was not part of the script but they kept it in.
Movies generally have a much longer production time than a year. So the script was most certainly finished before ST III was released in cinemas. So BTTF writers would only have knowledge of ST III if they also wrote it, and even then it's highly unlikely that at the time of writing BTTF it would've been public knowledge (or even a made decision) Lloyd would be in ST. Getting most certainly wouldn't have even started for BTTF.
Um, no. It doesn't matter if Back to the Future's writers knew about Star Trek III. It matters if Star Trek IV's writers knew about Back to the Future.
Back to the Future was released in July 1985. Filming for Star Trek IV didn't start until February 1986. It's very believable that the Trek writers knew about Lloyd's role in Back to the Future as they were writing the script for The Voyage Home.