Remove the key from the actor's inventory, add a small script to the actor with an OnDeath event, and in that event use AddItem to add the key to the actor. That way there is no key until he's dead. Note that this way the key can't be pickpocketed, though you could fix that as well with additional scripting.
I've been tinkering with "defaultActivateLinkedRefOnceOnDeath" on the actor but it requires a keyword. I can't figure out what keyword would be appropriate and it doesn't do what I want without one it seems.
The scene is actually a bit complicated.
On the key I have "GetKeyFromBanditEnable" to enable a ghost who motions you to the door once the key is in the players possession. It also activates three triggers that are meant to deactivate the ghost when the player gets close (using an xmarker). This ghost is standing in front of that door.
Right now, the trigger that activates the enemy also triggers the collision marker. To keep the guy from opening that door.
So, the enemy is not enabled until you go through a trigger and he shows up at a door to fight you. No chance to pickpocket unless you can hide until he stops combat.
Can you give an example of adding in item using the "Event OnDeath(Actor killer)" handle?