I will try to be as fair as I can to Loki, who gets plenty of bum rap in modern pop culture and doesn't need me piling anything on to his bad reputation.
Loki is frankly a bit of a cosmic prankster, and generally seen as unreliable for most things. But, one thing that is often not mentioned is his position as a sworn brother to Odin, and sure enough, when Odin's need is dire, Loki will come through for the All father, as can be seen in tales like the Building of the Wall of Asgard and preventing Skadi from starting a war of vengeance against Asgard when her father is slain by using what can only be described as the most amazingly awesome prop humour routine of all time.
In his journeys with Thor on Midgard, Loki is almost always the voice of diplomacy and reason, and saved many lives from being cut short by the Thunder God's infamous hair trigger temper with quick thinking and the right words. In fact, Loki is usually the one solving problems that Thor causes in these stories. Also when Thor lost his hammer (leaving Midgard defenceless), it was Loki who devised and jointly executed the operation to get it back.
While Loki is frequently seen by many as a villain due to his role in the tale of Ragnarok, he is actually more heroic than villainous (though he is always a prankster and troublemaker) and has become something of a fallen hero by the time that tale rolls around. Even then, he has very strong and rational motives for undertaking his sudden villainous shift. Even the death of Baldr (his other "villain moment") was an accident - Loki just wanted to see the invincible (and therefore pretty smug in Loki's eyes) Baldr get hurt and feel pain for the first time thinking it would be hilarious; he never expected that the prank would end with a corpse on the lawn, as it were.
Lokasenna also hints that Loki is a frustrated god, with him finally cracking and airing out a lot of "dirty laundry" that has been angering or irritating him for some time.
Loki is many things. He has poor impulse control, but he is also a silver tongued diplomat exceeding even Odin's level of skill on several occasions. He is capable and he knows it, which gives him an underlying confidence he seldom shows overtly. He prefers to be seen as lackadaisical and unreliable, but when the chips are down and push comes to shove, Loki will be one of the most capable, stalwart allies you can have, and nobody resolves conflict quite as creatively and effectively as he does.
Furthermore, he's generally a pretty good-natured personality with a jovial disposition until asked to do something he doesn't feel he should do, and then swiftly becomes petulant and annoyed, but he is also honest in his own way. If he gives his word, he will keep it. Finally, perhaps due to his own experiences as a Jotun in a court full of Aesir, he sticks up for the little guy on several occasions, knowing what it is like to be the outcast that few trust.
All in all, Loki is like a headstrong and rebellious teenager. He is full of his own conceptions of what is good and what he should be doing and is generally does not behave with an abundance of emotional maturity. Even so, he is fully capable of being more mature than he usually behaves when the situation calls for it - but only for as long as the situation calls for it, preferring to slink back to being an independent layabout and prankster as soon as the need is past.