here's the start of a basic way of doing it. the important bit is the holdit variable that is not changed back to 0 until the mouse is released.
sync on
sync rate 1000
width=800
height=600
depth=32
set display mode width,height,depth
make matrix 1,8000,6000,20,20
make object sphere 1,500
position object 1,4000,0,3000
set object 1,0,1,1
a=4000
b=-5000
c=10000
position camera a,b,c
set camera range 1,50000
zrotate camera 180
xrotate camera 45
yrotate camera 180
do
set cursor 0,0
print mousex()
print mousey()
print object screen x(1)
print object screen y(1)
opx=object screen x(1)
opy=object screen y(1)
if mousex()>opx-10 and mousex()<opx+10 and mousey()>opy-10 and mousey()<opy+10 then hit=1 else hit=0
if hit=1 then holdit=1
if mouseclick()=1 and holdit=1
`position mouse opx,opy
position object 1,mousex()*10,0,mousey()*10
print "got ya!"
endif
if mouseclick()=0 then holdit=0
sync
loop