Anyway, I was thinking about limitations presented by hard-coding, and came up with a way in which we might be able to get around the ones concerning Soul Gems. Most specifically, the kind you can acquire in Oblivion and Skyrim (I think): Black Soul Gems.
Normally, NPCs don't have souls to trap, but that doesn't have to mean that we can't Soul Trap them, right? For instance, I've hit NPCs with a Soul Trap, on accident, and it indeed stuck to them like any other spell with a duration beyond 1 second, it just didn't fill any of my empty Soul Gems after I killed them. So obviously NPCs aren't immune to being hit by such spells.
I also know that we have the "GetSpellEffect" function available to us, which can detect if any object, including an NPC, is under the effect of a certain spell. And modded creatures can be Soul Trapped, so long as their soul is given some kind of value, which means that that aspect is not hard-coded, so it should possible to, through scripting, to fill a Soul Gem with whatever soul we wish to, including one that is from a modded creature that doesn't exist in-game, but is labeled as belonging to an NPC.
Meaning, it should be possible to assemble a script that detects that the NPC in question has been struck with a Soul Trap spell, which then triggers, upon death, the addition of a Soul Gem (Grand, Greater, Common, etc.) to the player's inventory that contains the soul of a creature named after that NPC.
I imagine this script would need to be applied to every NPC in the game, although perhaps not if one made it like the script that disables levitation in Mournhold. Which I don't know if that's possible/the best method.
Am I on to something, or just dreaming?