When I'm scheduled to teach a class, I teach the class. If someone senior attends, I may or may not, offer them the opportunity to teach depending on whether or not there is something specific I want to do during the class time.
I'm fortunate to have the opportunity to have trained with some very skilled people. Since I established the dojo on the military base and have run it for a number of years, when folks senior to me in Aikido move to the area temporarily, I maintain the teacher's position in the dojo on the military base.
My first "run-in" over issues of rank started before I was even shodan. At the time, my Sensei taught the classes on the base and we were joined by a shodan from another style of Aikido. One day, my Sensei was not able to make the class and called to instruct me on what to teach. I asked him if he would prefer the shodan instruct the class instead of me and he said no. To his credit, the shodan remained through the class but, I assume, was somewhat insulted by having to receive instruction from me as he never returned.
The second occurrence was much better. After administrating the class for a number of years and receiving my shodan, my Sensei had me teaching more frequently. A US Air Force officer, whom I had met years before in Japan moved into the area and was assigned to the base where I taught. He was a Sandan and I was Shodan. From the beginning, he told me that this was my dojo, not his and he would teach only when I asked it of him. Otherwise, he was just there to practice. In my opinion, that is the proper attitude on the part of the senior ranked visitor. It was truly a blessing having him participate in the dojo. He taught periodically and influenced my Aikido, even when he was not instructing. Truly a model to be emulated. He even helped me to prepare for and pass my Nidan test.
There also is the case of the 20 some odd year practitioner that just hasn't tested in a while here. Even though his somewhat low ranking is not commensurate with his skill (there are several here that "out-rank" him) he is always afforded the respect that his ability affords him, and whenever I can convince him to visit my dojo on the base, I always afford him the opportunity to teach, primarily because I want to learn from him.
Rank does not always equate to skill. When someone of higher rank attends the class, I generally do not critique their technique unless what they are doing is inhibiting their partner. In that particular type of case, I'll utilize them as uke in order to "explain" the technique to their partner. This subtle methodology typically works. Generally speaking though, this seldom if ever, happens. The atmosphere of the classes that I teach is open enough for cordial exploration of variations in the techniques. Sometimes, I'll even consult with the senior ranked people on the technique during the class.
Etiquette wise, I cannot give you any type of answer. I personally offer the same etiquette to all people regardless of rank. I am not aware of any hard and fast rules regarding "who bows lower"; if I respect that person, I bow low.