I was stood behind the immigration desk at Don Mueang last week when my partner was clearing out of the country and saw that his last 3 passport photos popped up on the screen when the IO scanned his passport. Along with his fingerprints and entry photo. So yes, they know previous passport entries from your current one, it's all recorded.
As Robert says, you will go through immigration at the special transfer immigration desk at Bangkok airport. Follow the CIQ signs. You then arrive on Samui on a domestic flight but your luggage will be directed to the 'international baggage claim' and you go through customs there.
End of February we weren't asked anything by Immigration (we had last entered 11th December for 2 weeks) on a 30 day visa exemption - British passports. However, both times the airline asked to see our onward ticket and noted this on their system.
Yes, you need to contact the US Embassy and they will tell you everything you need to do and guide you through the process. The British Embassy helped us last year when a friend died, the US Embassy will be the same
we have always been asked flying from both Hong Kong and Manila. But we have had separate tickets out of Thailand when we've been asked. If the return or onward travel is on the same ticket, then as you say, the airline can see this and probably wouldn't ask.
The airline can still ask for onward travel proof at the gate. We had that happen once for the Philippines with Air Asia, we checked in at the machines but the staff were asking at the gate for onward tickets before they would let people board. You'll be ok because you have a return to show them
Airlines have told us that having a copy of your onward ticket on a phone, laptop or tablet isn't good enough. They have said if the battery fails on your device then you have no way to show your ticket so it's always best to have a print out.