I am not 100 % sure, but I believe if the technical is on the player, the other team gets the ball. If it is on the coach, then they would have shot the 2 technical foul shots first, and the 2 regular foul shots, with play continuing as if the two free throws were regular.