MOUSEMOVEZ() (and MOUSEMOVEX() & MOUSEMOVEY()) are cleared when you read them, and updated again at the next SYNC, so if you want to use the value from the function more than once in a frame, you need to store the value in a variable.
sync on
sync rate 30
make object cube 1, 1.0
move camera -20
do
movez = mousemovez()
if movez > 0
position object 1,0,object position y(1)+1,0
endif
if movez < 0
position object 1,0,object position y(1)-1,0
endif
sync
loop
Can you let me know whether this is on-target for your problem or not.