Probably be all in all much cheaper and less hassle to buy and sell when you leave. There isnt as wide selections as you´d get in the US or Europe, but you can find lots of bikes in Bangkok, so unless you need to find some specific model, I dont think it will be a problem.
Dont get a carnet for Thailand, because they are not in that system at all. They have their own temporary import paper for tourists who bring in their own bikes. You can keep it legally there for 30 days, but I hear a lot of expats work their way around this, so they can actually keep them there for longer without having to pay taxes&duties. Or some just visit Cambodia, Laos or Malaysia for a few days, then come back for another 30 days.