Part2. To add an action you can use the addaction command......If I may quote from the unofficial command ref
actionid=unit addaction["actiontext","actionscript"]
actionid is the name of your action, for use with the removeaction command
actiontext is the text which will appear on the units action menu.
actionscript is the scritp that will run when the user clicks on the action. It must be a file, not a command.
In your case the script will do little more that post the line of text "Eject not working". Look up the official command ref for another view on the same thing.
Hope that helps.