In the sentence:
Betty took two lumps, then saying, 'Well, Happy Birthday again.'
We know from context (the word "took") that this is happening in the past. So, using the phrase "then saying" implies she began an ongoing action of saying something, but we are supposed to assume that this has already transpired given the context.
You can think of this like there is an implied "began" (or "started") before "saying:"
Betty took two lumps, then began saying, 'Well, Happy Birthday again.'
Both "then said" and "then saying" are correct here, but "then said" is used much more in similar scenarios, and is what you should stick to if not confident. You cannot use an implied (vs. an explicit) "began" if the word "saying" is not preceded by "then."
This might become more obvious if we imagine a sentence in which it would be useful to say that someone began to say something, but didn't necessarily finish (as "said" would imply).
Betty took two lumps, then saying, 'Well, Happy Birthday to--' before being cut off by Margery.
"Said" would still be proper here.
Last night, she saying how good the pear tasted.
Last night, she ate a pear, then saying how good the pear tasted.
[Omitted "then she began"]
So, why did the author choose "then saying" over "then said?" What does this difference convey?
"Said" is simple and factual. It describes the fact that there are words coming out of someone's mouth. "Saying" can invoke or imply some broader point, something beyond just words.
For example, someone might want to draw more attention to a specific aspect of a description of a speech. "After the initial introduction, she congratulated the artists, then saying how their work became more thought-provoking over time." If "said" had been used instead, this would be a bit weaker: "said" just means she said the words. "Saying" implies she is really doing something by speaking, more than just saying words. She is engaged in an activity.
- Last night, she ate a pear, then saying how good the pear tasted.
- Last night, she ate a pear, then said how good the pear tasted.
If we were forced to bet one way or another, I would that the woman in 1. spoke for longer, with more intensity, or some other indicator of slight notability of the way she was saying it.
This aligns with the sentence "Well, Happy Birthday again." The "well" (and also but less so the word "again") makes it feel like there is something slightly notable or out of the ordinary happening here, perhaps something a bit melancholy. I'd guess that if the words were just "Happy Birthday!" then the author would have used "said." (Though either variant would be correct still.)