There must be a mechanism for space repairs or towing. Giant ring ships or warp sleds?I thought that for years, but recently figured it out. This is my explanation:
First they said that nothing in the universe could prevent the antimatter reactor from exploding. Then they said it could be prevented if you stop up the fuel line. And then it seems you can prevent the explosion by jettisoning the service crawlway compartment out to space, which would take a section of the fuel line with it and shut down the reactor. So why did Scotty ever have to get into the crawlway in the first place? They could have jettisoned it right away, with no one inside.
My explanation is that Scotty was trying to prevent the explosion without crippling the ship. If you jettison that compartment to break the fuel line, the ship will coast to a stop and be stranded in interstellar space. There would be no way to restore the warp drive. A predicament like this actually happened in "The Paradise Syndrome", and we just have to assume the Enterprise puttered around Miramanee's solar system after the story ended, waiting for a space tug to arrive. They still have subspace radio, but it's a big deal for a capital ship to become helpless and need its nanny. Very embarrassing and very expensive. So Scotty got in the crawlway and risked his life to save the ship from being stranded between the stars.
If they have a method of jettisoning a compartment, presumably they just need a replacement compartment. If a compartment can be jettisoned, you would have thought it could have been more easily hived off. They can beam Nomad on board. The compartment though might be as big as the whole transporter room. Still why couldn't they beam out a small section to cut off the flow?