If you still didn't get an answer in about 10 hours or something, I'll see what I can come up with. I know some scripts which do something very similar, making a specific sword remarkably more effective against a certain type of enemies.
The Deadra faction is an aspect you can check for in a script, so the detection part should be easy. The rest is just changes to the scripts I'm thinking of now.
I need to unearth them first though and then rewrite them so they serve your purpose, plus some explanations what does what and why it's used, etc.
It's past 6AM here and I need some sleep first as I'm too tired to do this right now. Sorry for the waiting.
Or take a look at Adonnay's Elven Weaponry and the Blade Weaver sword scripts yourself in the meantime. It's not that much code and pretty simple in my eyes.