It was heartbreaking for James to see his best friend in this vulnerable state. Fi is good from the heart. Too good, in fact. A person like her doesn't deserve all this. Even Miley was heartbroken. He knows that he used to tease her and get on her nerves, but that was only to divert her attention towards him. So when he saw her on the hospital bench in a broken state, his heart clenched. She wasn't like other girls. Sure, she was feisty, but she was kind from the heart. He knows it is a cliché, but she is the kind of person he would like to spend his entire life with. He hopes she has the same feelings as him.
But now, his major concern was Fi, who was fighting for her life. After the operation, it allowed only one person to stay at night with her, so it was Justin. So he took Miley home.