I don't know excactly, but as far as I know Maya and a little Mel there is no possibility to run a command as long as a button is pressed.
What you could do is to make a slider or catch the time you pressed the button first and match it with the time when you pressed it second. Then move your object according to how long you took to repress.