I have my doubts to the plausibility of a discriminating light sabre. For that matter, I have my doubts about any friend-or-foe identifying system that acts fast enough to be a weapon.
First, lets divide the system into two parts;
- Identifying friends and foes.
- Blocking/cutting/sabre-ing those that you don't like (your foes).
It's impossible to ignore Part 1 because you must be able to handle situations where friend and foe are physically touching, say, holding hands, or one has another in a headlock.
The engineer building this could decide that as a matter of policy, if friend is touching foe, then neither of them are allowed through. This is simple, but creates problems with the proposed cancer-killing-laser-scalpel.
Having your scanner inspect every cell's DNA against a database would be a thorough way of discrimination. But you'll want your scanner to have the following attributes;
- scan quickly,
- scan thoroughly,
- scan at-a-distance (as in without having to scrape a cell sample)
- and without obliterating the cell while doing so.
This is something I don't think any Type II or Type III civilisation is going to be able to do - it's just a limit of physics that leaves DNA proteins too fragile to work with that quickly.
If you slow the system down, again, you may have a system like modern security screening procedures - one locked door, a walkway, and another locked door. Your identity is checked and confirmed within the walkway. If you pass, the second door unlocks. If not, you get trapped, and armed-guards and attack-dogs are set upon you (that is a joke).
If you didn't go down the DNA verification path, you could try computer-vision with machine learning. This is a bit of a hot topic in academia at the moment as we've just now gotten to the point where computing power is both fast- and cheap-enough to identify objects in pictures and video in real time.
It's never going to be a foolproof system. The problem here is that your foes could just wear masks and make-up to look like friends. We have this problem today, and we get around by testing for unique properties that can't be fabricated - like fingerprints, retinal details, and DNA. Unfortunately, that puts us back at square one.
Part 2: tear through foes like paper (the fun part)
Take your pick! With the energy of a star available, energy efficiency is never going to be a concern.
To me, solid energy construct, and semi-permeable membrane seem to be incompatible with each other. If it's solid, then foes physically can't enter, but then we wouldn't have the spectacular immolation of our foes to witness!
My favourite system would be to hide a particle accelerator under the floor. Specifically, a dirty great electron gun. Point it upwards at your foes' feet, and tune it so that electrons have just the right amount of kinetic energy to tunnel (the quantum-mechanical effect) through the floor-boards, and into the bottom millimetre of your foes' shoes.
That layer instantly melts, vaporises, then blasts away as a sheet of plasma. Gravity takes hold and remainder of your foes' shoes drop to fill the now empty space.
This process repeats until there's no more shoes, no more feet, legs, and finally no more foe! All that's left is a room full of hot, smoky, atoms.
...and two footprints.