As I'll be staying in DXB for a few weeks once I depart AF, I'll apply to the consulate in DXB for the COE. If you're only transiting through DXB I'm not sure if you apply for your COE in DXB or in the US.
I doubt you can get a visa in the UAE as a non-resident. I'm also an American contractor working in AF and I'm planning to enter TH on visa exempt basis (15+30 days) apply for the 30 day extension, open and fund a bank account ASAP and then apply for an in-country, non O visa based on being over 50, then apply for a year long extension of stay when my non-O has less than 30 days of validity left and the 800K has been seasoned for at least two months.