Return flight: A 2-hour connection between HKT-BKK and BKK-PVG is enough as long as the first flight is not significantly delayed. You should check in for international in HKT and have bags checked through all the way to PVG. You'll go through Immigration in HKT then can stay airside once in BKK.
Inbound flight; If you are all entering Thailand at Bangkok Immigration, no problem. But if you are connecting immediately to a CNX or HKT flight, AND if your friends are Chinese passport holders and will do Visa on Arrival, then make sure you don't get that connection time too tight. VoA is not the simple entry stamp that most Westerners get, but a separate step in the process that can be time consuming if a lot of people are in the VoA queue.