Here's how I would do it, you'll need multiple systems in place. Use a Damage Engine to detect and prevent damage. Use a custom Buff system so you have control over whether a Buff can be applied or not. Use your own Knockback system or edit an existing one to work the same was as the Buffs.
Then you'll need to mark your units behind the Barrier as "immune" or something. You can use a Unit Indexer, Hashtable, etc...
Unit.IsKnockbackImmune = True
Unit.IsBuffImmune = True
Unit.IsDamageImmune = True
So all of your systems will check for these states before affecting a unit. If the unit is KnockbackImmune then don't apply the knockback. If the unit is BuffImmune then don't apply the buff. If the unit is DamageImmune then Set the damage taken to 0.
It'd probably make more sense to use Integers to track the state of these properties instead of Booleans. For example, Add 1 when a unit gains an instance of KnockbackImmune and subtract 1 when they lose an instance of KnockbackImmune. So if KnockbackImmune is >= 1 then they're immune. This way you can have multiple effects that grant these properties and they'll all play nice together and stack properly.
I wouldn't bother trying this unless you're confident in your triggering/coding capabilities.
Perhaps an alternative solution could be done by Periodically Removing Buffs or making the Units spell immune. It's really only the Buff stuff that is difficult to manage since you can't detect these properly unless you're applying them yourself via triggers. This is the sort of thing that you design your map around from the very beginning, otherwise you're going to have trouble making it work properly. But maybe you can find a nice compromise and make it close enough to what you originally wanted.