Don't worry about it. Just overstay by 4 days. Pay a 2000 baht fine. It really isn't a big deal. I overstayed accidentally once and was really worried about it, but they don't care. You'll be fine. No trouble, just pay at a little desk in the airport immigration.
If it's separate bookings, you will have to pass immigration to Bangkok. If it's bone booking you'll do immigration at your final destination. I'm 100% sure having thought about it.