You could apply a bool on the death check where the items are moved into the bag, sorry I don't know where that's located right now.
If the item is equip and insured or blessed ext, then have a bool for on the object basewearable, would be my guess, for equiptOnRes. That's normally false, unless the conditions where true. Then when you go to res person, check all items in bag/inventory and if the equiptOnRes is true put it back on.
Now if you don't want to edit the basewearable to add the bool to it, for whatever reason, you could instead use an XMLData attachment, or a new attachment, if the attachment is there, equip.
There also should be an event for death, I think there's also an event for res.
Subscribe to the events and using the attachments you wouldn't need to make any edits, just add a custom script