You need to transfer the visa after you get your passport. Take both passports and the letter from the embassy to immigration (or do it at the airport when you leave) and they'll move it to your new one.
A friend did it a few weeks ago in BKK, took less than 14 days to get his new passport. Note, the US embassy holds your passport in bkk, it doesn't leave Thailand. If you need your passport while your new one is being sent to Thailand, you can ask them for it. It's still valid until your old one is issued.