From what I recall, the set that we saw in TMP had first been constructed for New Voyages in 75, and then it was upgraded for theatrical use, and then appeard in Star Trek II. Star Trek III you had that one section of Scotty in engineering right at the start of the movie saying that everything was almost fixed, but that didn't show the entire set, just a small wall that James Doohan was in front of for the one scene, otherwise engineering wasn't in the movie. Star Trek IV didn't feature the Enterprise's engineering. The set was then repurposed for TNG, with parts removed, repainted and rearranged. One thing retained from the TMP set in, essentialy, it's TMP appearance was the elevator that you see Picard and Worf riding down in Encounter At Farpoint that Kirk had earlier ridden in TMP. Star Trek V had Scotty roaming all over the Enterprise-A due to the deteriorated condition of that ship, so main engineering was not seen, although where Scotty bumps his head, as far as I can tell, was meant to be somewhere under main engineering. By the time Star Trek VI came around and an engineering set was needed (not to mention corridors), it was cheaper and easier to redress the TNG sets. And then later the set was modified to be Voyager's main engineering, and as I recall was finally struck and torn down in 2001 at the end of Voyager.