First, its not revengemode that deops users.. Its bitch mode...
and for the second, if a user has mode +d on a channel/global he/she will always be deoped.. So, first use
If he/she got a +d .. remove it with
and then check if he/she got +d channel flag,
Can you quess what comes next? Right.. If he/she got +d.. remove it using
To prevent a user from getting +d, set mode +f.. I sure hope this was to any good for ya...