Hmmmm, I have never heard of this. I am wondering too what his motivation is. You say he only does it when he is upset or annoyed with someone, so maybe he has realized that this is the one way to really let people know he is MAD and it will convey to them in a way that will force them to feel equally annoyed.
If time outs and ostracization have not worked, perhaps more discussion of appropriate ways to handle the feelings of annoyance and aggression. Instead of, that's naughty, try as you scoop him up or physically redirect his body away from his victim while you help him re-dress "Ryan, you seem annoyed, can we use our words to tell XX that you are annoyed?" If he draws a blank (as I would guess he does not know how else to express these emotions as even after punishments he can't help himself) help him: Gee, XX I wish you'd give me some alone time, I don't want to be near you right now." or "Gosh, XX, I really want a turn with that toy, can I have a turn now please? When can I have a turn?" or "Hey, can you stop shouting at me please? I don't like it when you shout at me." Or whatever it is that you think it is that is annoying him. You may suggest to the teachers this method as well, as teachers of larger groups tend to not think of the individual needs as much as the group needs and rely on time outs as a way of deterring unwanted behavior but rarely remember to address the feelings that lead to the behavior and how to give better coping skills.
It seems to me from what you said that he understand that it is naughty, unacceptable, private, etc. but that it is worth it to him to get in trouble to express his feelings that way because it gets the results he wants which is to make the victim of his genital slapping feel the anger, disgust, frustration and general upset he is feeling so the idea is to give him an even better tool to express his anger and frustration. If he can name it, it will probably be easier for him to express what he needs.
If he needs a physical release before he can verbalize his feelings, perhaps a punching bag at home, or some cushions in the classroom?