Hober Mallow wrote:
"Brought a tear to my eye," was obviously a line meant for McCoy. They just swapped him for Scotty. Paint-by-numbers scriptwriting.
As is his jokey "Finding retirement a little lonely are we?" He and Kirk were never quite that familiar. Kirk's reply as originally scripted was probably something like, "You know, I'm glad you're a physician. With tact like that, you'd make a lousy psychiatrist."
Then there's Scotty's Spock-like "I do have a theory" and Chekov's inquiries about the medical staff and, "You and you, you've just become nurses...", which is so painfully McCoy. Nimoy opined that there was no specific function for Spock in the original draft, and that the writers could have just swapped his and McCoy's lines for any of the other characters without anyone noticing, but I disagree; they did just that, and it's painful.