I vaguely recall a quote from Scotty of Star Trek:TOS where he indicated that it's important to always leave a little extra behind so that you can pull it out at the right moment so that you appear to be a genius. Whether this was in TOS or another movie I don't know for sure. Does anyone have memory of the exact quote?
This is from Star Trek III:
Kirk: How much refit time till we can take [the Enterprise] out again?
Scotty: Eight weeks, sir. (as Kirk opens his mouth) But you don't have eight weeks, so I'll do it for ya in two.
Kirk: (considers) Mr. Scott. Have you always multiplied your repair estimates by a factor of four?
Scotty: Certainly, sir. How else can I keep my reputation as a miracle worker?
Scotty: Shunt the deuterium from the main cryo-pump to the auxiliary tank.
Geordi: The tank can't withstand that kind of pressure.
Scotty: Where'd you get that idea?
Geordi: What do you mean, where did I get that idea? It's in the impulse engine specifications.
Scotty: Regulation forty two slash fifteen, pressure variances on IRC tank storage?
Scotty: Forget it. I wrote it. A good engineer is always a wee bit conservative, at least on paper.
The Next Generation Season 6 Episode 4 "Relics"
This is the closest I can find, from TNG: Relics
Geordi La Forge: Look, Mr. Scott, I'd love to explain everything to you, but the Captain wants this spectrographic analysis done by 1300 hours.
[La Forge goes back to work; Scotty follows slowly]
Scotty: Do you mind a little advice? Starfleet captains are like children. They want everything right now and they want it their way. But the secret is to give them only what they need, not what they want.
Geordi La Forge: Yeah, well, I told the Captain I'd have this analysis done in an hour.
Scotty: How long will it really take?
Geordi La Forge: An hour!
Scotty: Oh, you didn't tell him how long it would 'really' take, did ya?
Geordi La Forge: Well, of course I did.
Scotty: Oh, laddie. You've got a lot to learn if you want people to think of you as a miracle worker.