Tony would likely be defiant. He's not the type to cower in the face of danger. He might immediately start looking for weaknesses in Thanos' setup and try to escape on his own terms.
Tony would probably be constantly thinking about how to contact the Avengers. He might try to send out some sort of signal using his knowledge of technology, even if it's with the limited resources available in Thanos' captivity. His mind would be racing with ideas on how to not only get out but also how to stop Thanos from whatever evil plan he has in store.
If the hurt is physical, Tony could retaliate in self - defense. He has his Iron Man suits, which he could use to protect himself while still trying to avoid causing too much harm to his former friends. At the same time, he would be deeply hurt emotionally and might start to question his relationships with the Avengers.
Tony could be initially shocked. He might not understand why Peter would run away, especially if they had a good relationship before. He'd probably start searching for Peter right away, using all his resources.
It could also end with a more complex resolution. Loki realizes the error of his ways during the time he has Tony kidnapped. Maybe through their conversations, Loki sees the value in Tony's life and the good he does. So, Loki releases Tony and decides to help the Avengers in their fight against a common enemy as a form of redemption.
Tony might be initially skeptical. He's been through a lot and has trust issues sometimes. So, he might not immediately accept Rhodey's apology. For example, he could give Rhodey a cold look and say something like 'We'll see if you really mean it.'
At first, Tony might be in denial. He's so used to having Pepper by his side that he can't fathom her leaving, especially when she's pregnant. As time goes on, he could become very sad and start to reflect on what he did wrong in their relationship. He might try to win her back, using his resources and intelligence to show her that he can be a good partner and father.
Peter might be embarrassed at first. He's been idolizing Spider - Man and now Tony, a real - life hero - like figure, knows about it. But then he realizes that Tony could be an even greater source of knowledge and support, so he becomes more open about his love for Spider - Man.
Peter might be initially shocked and a bit scared. After all, Tony is like a mentor to him. But then he could become defensive, trying to explain his actions or point of view.
Perhaps Tony, knowing Peter's character, is somewhat expecting the interruption. He might have a wry smile on his face and then listen to what Peter has to say. He could also play it cool and make a joke about Peter's eagerness to interrupt his meeting, while still giving Peter a chance to explain his reasons.
Peter may try to get Tony's attention back. He could show off his own skills or achievements in an attempt to remind Tony of his value. For example, he might go on a solo mission and do an amazing job, hoping that Tony will notice him again.
Tony would probably be extremely hurt. He trusted his team, and betrayal would cut deep. He might initially be in denial, not wanting to believe that his friends could turn on him.