I'm trying to grasp when I should use a period or a comma after a speaker tag when it's in between dialogue? Example: “I’m going to work out at the gym,” she told Brian[,] “and you’re welcome to come along.” “No thanks,” he answered[.] “I’ll just stay here and read my book.”
it's easy enough... a comma, if the continued dialog is part of a sentence started in the first part... and a period, if the first part is a completed sentence... in other words, just like you've done it! the easiest, fastest way to learn the rules 'n regs of dialog is to simply open a few novels by decent writers and see how it's done...
I think I've always only used periods in this, never really thought about it before, but I think how you've done it in your example is right. I guess it would be like continuing the flow of what is being told, except it is being said and the writers stating by who in the middle of it. Don't know if my thinking is right, but that's the way I see it.