Read about how to check special keys. You probably want to read the whole page
http://www.autohotkey.com/docs/KeyList.htm#SpecialKeys
Below is a script that accomplishes steps 1, 2 & 4
So after you run the script, hit the 'unknown' key and press F5 to refresh the Key History display.
Make sure you scroll to the bottom of the list to get the latest key(s).
This should at least get you started.
Code:
#InstallKeybdHook
;#InstallMouseHook
KeyHistory ; Display the history info in a window.
esc:: ; in case of emergency, hit escape to exit
exitapp