Placing punctuation outside the quote marks when it isn't logically part of the quoted material is often called the "British" style (versus the "American" style, in which commas and periods are placed inside the quotes). However, it's possible that not all British writers do it the "British" way, and, I guess, not all American writers do it the "American" way. For what it's worth, I am British and I would punctuate the sentences as you have (except I don't see why #4 needs the last comma).
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.