Yeah, that is one of the more puzzling bits of the original Star Wars. In the radio drama there is actually a scene, where Threepio convinces the owner of a private residence that they are a part of a new maintenance crew and they are offering their services for free to attract customers, so the owner lets them in and they can hide from the stormtroopers. I don’t know if this is based on anything from the scripts or the novelization, but it works quite well.
To me another weird moment is when the stormtroopers find the droids hiding in the closet in the DS control room and Threepio just tells them that Luke & co. are at the detention levels. It always seemed to me like he got scared by the stormtroopers and ratted everyone out. The radio drama once again makes it clear that Threepio deceived the stormtroopers into believing that the droids are a part of the DS personnel and have been locked in the closet by the intruders, who are now making a racket in the detention block.