From what I can remember Tony does something that scares Rhodes and Pepper so they take him to court to have him committed.
While he is there he meets and falls in love with Loki.
I'm pretty sure it was an AU where there were no Avengers and Phil was the directer of the institution but I might be wrong about that.
If anyone has any idea where I can find this I will be so grateful. Also if anyone knows of any similar fics then I would be very interested to hear about them.