Are there methods to reduce noises that are generally accepted to be irritating while preserving other high frequencies?
Maybe some pitches are acceptable, but only for a limited amount of time, so a filter would have to notice and adapt to that?
Everybody has a different tolerance as to what they find "irritating". Something that you personally find irritating may not be irritating to someone else.
Your best bet is to use an EQ to resolve any frequency issues and also work within a monitoring environment that has been correctly calibrated.
You want to use an equalizer (EQ). I'm not sure what context you're working in, but an EQ is the tool that's used to "filter frequencies".
What you've specifically described is not really possible without automation, which is fixed and requires a human to program. You mentioned you wanted it to adapt on it's own which is not possible, at least not in the way you've mentioned. It's also over-complicating the issue.
I'm not sure you really want this type of automation. A fixed EQ is more than sufficient here. If you only want to affect a very specific frequency, you can use the Q to narrow the band of frequencies being affected so you can filter out the "irritating" frequency while leaving the others virtually unchanged.