Direct quotes from The Enterprise Incident:
Just after Kirk beams onto the Enterprise with the cloaking device. The exchange is between Scotty and Kirk:
S: "But, sir, what about Mr. Spock?"
K: "We'll just have to hope he can buy us enough time to get this cloaking device installed."
S: "Aye. It'll have to be hooked into our deflector shield control."
K: "Can you do it?"
S: "I don't know, sir."
K: "You have 15 minutes, Scotty."
Later, Scotty says, "I've got the device installed but bless me if I know if it's gonna work. Its the biggest guess I've ever made."
Later still, Kirk contacts Scotty and the following exchange occurs:
"Scotty, switch on that device"
"I did, sir. It's not working"
This tends to preclude any previous preparations to accomadate the cloaking device within the Enterprise.
Later Spock says this to the Romulan commander, "Military secrets are the most fleeting of all."
Apparently Roddenberry liked that phrase.