There wouldn't be an issue with those entries to Thailand unless you have an extensive history of traveling/staying in Thailand.
On the first entry or check-in for the first flight to Thailand, if you are asked for proof of onward travel, you show the ticket to Vietnam. On the second entry, you can show the return tickets.
Just in case, you bring proof of funds (
*****
thb equivalent in cash) and proof of accommodation for the first few days at least in hand when you enter Thailand.