I've seen things where a really high ranking officer would straight up walk past someone and not return a salute.
Ah yes, in the military that is known as "being a dick". It shows disrespect to the lower ranking person. The higher ranking person always returns the salute, unless they are being a dick, or they have some other reason for not acknowledging the salute.
> Or others who are merely in the room snap to attention and salute as the officer is entering or walking by.
That's known as "calling the room". Usually an adjutant will proceed to enter a room before a Colonel (or General) and announce that the officer is entering. He'll say "standby", and then as the col/general enters the room they will call "room attention". At which point everyone stands up until told to sit down. Usually this only happens with generals, or for the CO of the unit. Since this practice is performed indoors, no one will salute. Salutes only happens outdoors.