Fundamentally, all items work the same and the category is just for sorting. You just need to give the key item a validflag for using in field, a use_script and an use_arg and it should become usable. The actual functionality would be in the use_script, and if you don't need the use_arg you can just ignore it in the script.
(Check out init_items if that explanation didn't make sense)