Ok, so, click the cabinet object...
After that, click the 'Container' tab. Make sure 'Container' is chosen.
Make sure the action of the verb 'list' is displayed.
For the key object, make sure the Parent is the cabinet object.
Click the Inventory tab.
Choose 'Run a script when the player types "take...":'
Add a conditional script. Add a condition.
Select the 'The player has an object' condition. Type 'key' under the 'Object:' text.
Click OK.
As the 'Then' script, print a message saying "You already have that.".
Click Ok.
Edit the 'Else' script.
Add a script that prints a message saying 'Taken' or something that tells the player he/she had taken the key.
Add another script that would modify a property.
TO do that, collapse the 'Modify' group. Choose the property script.
Type 'key' as the Object or Room name.
As the property, type 'parent='. That means you would change the parent of the key to nothing.
Add one last script. Collapse the Objects group and choose 'Give an object to the player'. Type 'key' or choose the key object.
Click OK.
Click OK.
Hope it works