McCoy - you are confusing the I-PAC shift function and the KeyWiz shift function.
The KeyWiz doesn't send a function when you press Shazaam! unless you do some complicated wiring tricks to make it work - see
http://www.mameworld.net/tigerheli/encoder/shiftkeys.htm for full details.
FWIW - I went down the same road as you - here's what I did.
I started with dedicated buttons for Esc and Pause - Not using the Shazaam! function although I did have a button for it. I ended up accidentally pressing Esc once in the middle of a game, so I noticed that Shazaam! plus Terminal P (Esc) sends "=" so I reconfigured MAME so Quit (UI CANCEL) was =, not Esc.
To do what you want, note that Terminal K is P (Pause) on the KeyWiz, and that Shazaaam! plus Terminal K is 7, so just reconfig MAME so Quit is 7 rather than Escape (and reconfig coin 3 if you play any 3 player games).
There is another way to get a dedicated escape button without loss of inputs....
That's to wire a button to joystick 1 switches that will activate both up and down at the same time.... As it's normally impossible to push a joystick up and down at the same time, this button then sends a unique two button press that you can allocate to mean esc in Mame.
Best Regards,
Julian (Fozzy The Bear)
Fozzy, I cover that here -
http://www.mameworld.net/tigerheli/encoder/pausekey.htm, however, this will NOT work on a KeyWiz.
The KeyWiz disables simultaneous Up and Down inputs on the P1 Joystick in it's firmware. The P2 Joystick can be used and P1 Left and Right can be used. There generally isn't much advantage in using one pair of Joystick directionals over another.
I am mainly mentioning this so McCoy178 doesn't try your idea and get mad that it doesn't work.