Sorry this is going back a bit, but I thought I should comment:
I would suggest that it's OK in informal writing, and that includes dialogue.
As for the red text: THAT'S NOT HOW USAGE WORKS!! If it's illiterate in one register... IT'S STILL JUST AS ILLITERATE IN A DIFFERENT REGISTER!
I agree with all of Brandon's post except for this - sort of. I agree that if something is grammatically incorrect in one register, it's grammatically incorrect in all registers. Ideally, one should try to be as grammatically correct when speaking to friends as one is when writing a job application. (That's not to say you'd use the same vocabulary, though.) After all, grammar is for making oneself understood, which applies informally.
BUT, the same is not true of writing dialogue. While I wish every English speaker had perfect grammar, it's simply not going to happen, and if all your characters speak with perfect grammar then (unless they all go to an English public school or something) it's not going to be true to the characters. If a poorly educated character with no interest in literature says "If I were you" instead of "If I was you" then it will be out of character, even if the phrase is grammatically correct. Likewise with "My friend and I/me went...", "I'm better than he/him" and "It's he/him". Although the former option is the grammatically correct one, almost nobody knows this, and it would be really weird for everyone in a film, book or videogame to speak in a grammatically correct way. While it would make the grammar more palateable and soothe all our inner grammar nazis, it would almost certainly compromise the integrity of the characters.
Two things I will NOT put up with, though, are poor grammar from a narrator or another intelligent character, and poor grammar or spelling in subtitles. Both point to a lack of grammatical knowledge among the writers themselves, which is just unacceptable.