My problem is that, while I could easily work this spell the same way the Ore Transmutation spell does (check the player's inventory for an empty gem, replace it with a full one), that won't work for Azura's Star. I searched the script manager for the word "soul", but I can't find anything that looks like it manipulates the player inventory. There's one to handle the visual effects, and one that checks whether the target died under the appropriate conditions, but nothing that I think actually FILLS the gem.
Does anyone know how I can fill a soul gem the same way soul Trap does, just minus a dead target? Where's the script for it? And is there any way to automatically adjust the length of the soul debuff to match the timescale, so that it always lasts 24 hours?