The system doesn't do it anyway.
Like you can be as toxic as you want, as long as nobody reports you in that game you won't be punished because your chatlogs won't be analyzed.
Either way the person having a bad game and flaming for it is going to get punished by the players flaming him ontop of a chat log res.
The thing is that if you reply to someone flaming by insulting him too,** you're lowering yourself to his level **and if someone reported you in that game you deserve a punishment too. You can reply to flame but never with insults/harassment and so on.
For RIOT, context doesn't matter at all, it's individual behavior that counts, hence why when someone is punished only his chat logs are analyzed and he is judged only for what he typed, what the other players said doesn't matter at all.
If the dude was flaming like you said, and you reported him, be sure that he'll either get a punishment, or the report will stay in his history if it wasn't that extreme and will counts when deciding further punishments another day if reported again.