What is the meaning of "On that note" and how do you use it? Does it mean "while we are talking about the same subject?"
Your assumption about it's meaning is largely correct. It typically is used to transition from one subject to another subject on the same topic.
It's meaning can also be expanded to include associated emotions or feelings. This can be seen in similar expressions like: "On a happier note" or "On a sad note."
In a comedic/sarcastic manner it can be used to indicate the unpleasantness of something said or done and the need to move on to another, less unpleasant subject.
For instance, three men are socializing at the bar. Man 1: "You know, I was thinking of wearing assless chaps to the party next week." Man 2: "And, on that note..."