If you leave the airport, the tax is due.
Airlines are supposed to collect it when issuing tickets, but don't have to collect it if ticketing a connection -- then if you leave the airport you have to pay in cash.
UA never seems to collect it from me, stopover or connection regardless.
I had to pay it last time through BKK in March (F checkin took my THB700 and went and paid it for me).
Time before, boarding at HKT and connecting in BKK, TG didn't notice...