Well, I'm not quite sure what you are asking. But one thing you probably want to change:
if mx#<0 then mx#=1
if mx#>10 then mx#=9
if my#>20 then my#=19
if my#<4 then my#=5
To:
if mx#<0 then mx#=0
if mx#>10 then mx#=10
if my#>20 then my#=20
if my#<4 then my#=4
You want to make your check the same number as your repositioning. Otherwise your object will skip around.
Any chance you could restate your question? I'm not quite clear on what you are asking. The only other thing I could think of that would give you problems is that maybe the object isn't moving in sync with the mouse? This can be fixed by two ways in this code:
position object 7,mx#,0,my#
Either change the y position (currently at 0) to something else. Or, and more preferably, devide the mx# and my# variables by different numbers. Experiment to see what numbers get it matching more closely with the mouse.