Once you managed to open the door, let it open for a while, and the guard inside will go for a little walk, eventually he'll leave the treasure room. In the meantime others may come in, but they will leave again. You just have to be patient and wait for the right moment. Once they're all out, close the door so they can't come in anymore. That doesn't mean that they can't see you once they stand in front of the door though, so loot carefully.