No script required. Just open up the console, select him, and use
RemoveAllItems. Then give him a few days to respawn his normal inventory.
... hmm.... you might also want to check his normal inventory in the CS and find the formID for his key, and give it back to him with
AddItem 00xxxxxx where xxxxxx is the formID of the key.