You did fine I think but as my own experience being on both side of that door to the room I think it is best to speak up and not be silent. My reasoning is this.
I travel 4 to 5 days a week lots of experience in hotels. I have actually been given a room that already had someone in it and walked in on them because the key card worked. More than once.
I have been in my room, never already asleep. When someone has entered the room with a key card ,the desk clerk gave them the same room.
I have had a drunk try to get into my room his was next door all worked out well.
I always have my gun with me and I have really worked on situational awarness and it can be a tuff call, To me you handled it perfect because you never know in a hotel if the desk clerk is paying atention or because of unfamiliar surroundings someone has made a simple mistake you must be extra cautious there are a lot of variables staying in a hotel that are very different than your home.