Immigration will be open at HKT.
Assuming UA will interline your bags and you are confident in that process then your plan should work.
On a recent TG flight BKK-HKT, as a domestic passenger, I was in a fixed gate (A6) area in the domestic concourse with ~ 250 passengers (747), most of whom were in international transit. But they could have easily walked back through to the domestic terminal building and entered Thailand bypassing Immigration and Customs. There have been other reports here of domestic pax being bused to the plane, and/or int'l pax being bused to the plane?
AFAIk the TG lounge in concourse A does not have showers. Some TG lounges may still be open (until 01:00?) but I am not sure what their entrance requirements might be. Maybe they'd check you in for the next day's flight?