Well, they had a pretty good scene where Medusa was talking to Avenger in Hollow, and it went in depth with who she was before, why she so loyal to Sakura, and why a former divine spirit like her would become a spirit that aided a human. Iirc, it went into how much she originally liked humans, and pieced together some of the other bits that went into her past.
It was an interesting talk about what makes one a monster and such. Though I kind of wonder what Nasu would think about that part now after he made a character like Gorgon.
Either way, in HF, Medusa filled the role of a poisonous friend of sorts, where her desire for Sakura not to become a monster like her is mixed with the hatred she has for being ostracized and hunted as a monster.
From her perspective, you go all in for the people she cares about, and she saw Shirou was too reckless and inexperienced, thus a danger (so her methodology does the extreme thing of hanging him in front of her), or that Rin is too wishy washy, so she doesn't put her trust in her.
Medusa has this very rash way of thinking despite how cool she seems, which fits the chaotic part well. She has a very selfish almost fae way of thinking, and projects herself onto Sakura. She assumes what Sakura would want and believes what she does is for the best.
It's why when Sakura sacrificed the last command spell, that was the turning point that made her really understand, which is why she saved Shirou not too long afterwards. But then you might be thinking, "so why did Shirou have to jump through so many hoops later on to get her as a partner". The answer is of course because that doesn't mean her desire has changed, so someone who is half in/half out on trying to save her charge won't cut it. From her perspective, killing Sakura isn't a mercy, it's her seeing again a "monster" being put down that was made one outside it's own will.
So what she sees at the end of that isn't mercy or freeing someone, it's just plain death and a corpse who can't really care about their happiness because they are dead. So it's kind of no wonder why she was as stubborn as she was, or as fickle as she was.