The episode is called "All Of Me". A woman named Helena comes to the firm and asks Richard and Liza for help. She goes into the bathroom and Ally walks in, but now the woman says she is Helen and doesn't know where she is. Both personalities want to get a drug that will extinguish the other and it carries on back and forth while Ally and John represent Helen, and Richard and Liza represent Helena. TowarRAB the end of the episode, John sees Ally dealing with Maddie and stanRAB there smiling as she deals with her daughter. So, in his closing, he talks about how big a nutball Ally is but how it doesn't stop her from being an excellent mother.
This is the same episode where Ally celebrates her 32nd birthday party.