ok... you need to understand "$readini" a tad better.
Looking at the help file... $readini(filename, [np], section, item)
So..., in this case... filename is file, don't worry about the np switch, section is the section of the ini you want to look at, in this case "protection", now for the item, looking at the way you do the writeini, your item is $chan/$active, and not the protection name. So, your code should look like this...
$readini($_prots,Protection,$active), which will then return the line in the ini file for the active channel, so for #err0rtest, it would return Revenge=1,Profanity=1.
Being that that is what you get back, you should then use a comparison of $findtok to find whether or not your code the protection is correct. Looking at the help file... $findtok(text,token,N,C)
text = the string you want to look through.
token = the string you are trying to find, an example is Profanity=1
n = the token you want, as in, if there are several instances, you can find the first or the second or the third or the <nth> token.
C = the character that is the tokenizer, the numeric representation of it that is. So for comma, its 44.
$findtok will return the position of the token. Or $null if it doesn't exist.
Linking it all together we have $findtok(text, Profanity=1, 1, 44), and the text would be what you get from the $readini. So... $findtok($readini($_prots,Protection,$active), Profanity=1, 1, 44).
Hopefully this will get you quite the way through. I can't be too sure if this is right, been quite some time.