To me a 'nearly new' motorbike should be as good as new. There should be no mechanical problems with secondhand bikes. Most modern bikes just don't have them or, if the odd thing has cropped up, they should have been sorted under warranty. The problems you're most likely to run into are if the bike's been stolen or did a touchdown on the tarmac. It's always worth getting the bike checked at the Department of Land Transport (especially for big bikes). Buying a so-called invoice motorbikes is not discussed here for the obvious reason that it never can guarantee that the bike will ever be legally road-worthy. It's also a good idea to ask for more information of the different motorcycle online forums, the Motorcycle Thailand Forum is a good start.
Because some parts prices are can be pretty expensive I've never known anyone replace everything that's been damaged during a crash, so have a good look. Check the pegs and engine casings to see if they've been down. Then follow the scratches to find more evidence on the body work. Also mirrors and handlebar ends – anything that can touch down. The bottom of a fork leg can get chamfered off in an accident so check they're both the same shape and haven't been filled.