Why should we think that the door would be some sort of an evil starship-trap? The tractor beams are there supposedly in order to help
starships get in; it would only stand to reason that there would be similar beams on the inside, bending over backward for a chance to help any approaching ship get out.
Neither set of heroes ever voices out a rationale for why the door would not
simply acknowledge the approach of the E-D and help her out, with a polite bow and all. There's no mention of trying to open a door from the inside, let alone of trying and failing. Scotty and LaForge just jump to conclusions and quite possibly needlessly expend a starship and two photon torpedoes.