Regarding Thomas...is it possible he would instigate that beating to get on James' good side? It doesn't seem likely, since the muggers had ample reason to mug James--all that money he was flashing. And, again, it's been a year since their dust up so maybe things are better between them.
No, I don't think it was in any way planned. But since Thomas still carries a torch for James, it was only natural he would step in to try to save the little idiot. I liked how they "buried the hatchet," so to speak, and agreed to be friends. It was probably the first grown-up thing we've seen James do.