definitely possible, but if I understood you correctly, not really a mana shield in any way though
I would go about it like this:
first you need a basic spell trigger to start it all that defines the center of the spell (caster/cast point -however you want it to work) activated by a channel based dummy spell. create a unit group of all units in the range the shield covers. both allied and enemies (what I understood is that shouldn't kick out enemy units, just not let new ones enter) .
turn on the looping trigger. and in the dummy spell you can define the mana cost.
periodic looping trigger : checks if any of the units in range of caster/cast point (however you want it to work), are enemies of caster that are not in the unit group, and if they are moves them out of range(using the angle between them and the center of the spell). checks if any units in the unit group are no longer in range and removes them from the group, and checks if any new friendly units entered spell-range and adds them to the group.
checks if units are attacking the friendly units inside the unit group and if so orders them to stop. (this will stop people from issuing attack orders even from far away, so if that is a problem, make this more sophisticated) [this one may need to be a separate trigger that starts with the event a unit is being attacked, and filter it so it only cares when the attacked unit is in the unit group.]
you also need to add a stop condition for the loop - do you want this spell to only continue while the caster is channeling, or is it a cast and leave ability like flame strike with a predetermined time for the shield to last?
If you need help fleshing it out maybe I can find time to help with that...