With regard to entering your apartment: Is there something in the lease that addresses what notice they must give in order to enter? One option would be, in the future, to just be mindful of whatever is required, and be prepared to say no if those conditions are not met.
With regard to asking her to please not yell at you: It sounds like you handled things really well in the moment.

In reading your description of the event, I see that when she yelled you walked away. It seems from what you wrote above that you got across to her that she shouldn't yell at you: She became nice and then gentle and conversational. So one way to look at the situation is that you already, in a skillful and effective way, have made your point about not being yelled at.