I suggest rebinding the extra keys at the X level using xmodmap so that instead of all the funky keycodes like "undo" they trigger standard F codes like "F20". This makes them much easier to bind in programs like terminal and hence vim.
You'll need something like this in your .xmodmaprc file:
keycode 139 = F13
Then the key becomes mappable in the usual way. From your .vimrc file, you can create a mapping like this:
map <F13> YOUR_COMMAND_HERE
The above works for bindings at the X level and will work for gvim, however key codes in terminal programs are a little different. You may need to tell vim about your new keycode so that it knows that the crazy thing sent by the terminal is an F13. You can do this by adding a line above your key map (see above) like this:
set <F13>=^[[25~
Of course what crazy code sequence you need there will vary depending on the key you are binding and your keyboard and your terminal, etc., but it's really easy to fill in. Using the terminal you usually use open your .vimrc with vim. Fill in the first part of the line set <F13>=
then still in insert mode hit CTRL+v to insert a visual key code, then tap your new F key that you are trying to bind. Voilà, keycode found an inserted.