In the novelization, Scotty realizes he's met one of his "engineering heroes"--the man who invented transparent aluminum. Therefore, his "giving the formula" is rather like Spock Prime's giving the transwarp formula to Scotty in the new movie. Just a tangential bit FYI.
Mister, you've just solved one of the biggest mysteries I had regarding Star Trek. Okay, I'm exaggerating a little but, seriously, thanks, that somehow makes it all right for me.