I haven't tested this code, but I think this should work:
What I've done is to replace your gosub bit with a while loop, and made a 'flag' called collision which equals one if the tree being placed touches another one. What happens is that each time you position a tree collision is set to zero, and then it loops through the trees already made to see if there's a collision. If there is then collision is set to zero, so the program loops back to where it says "while collision=1", another position is picked and tested and so on until a position is picked where there is no collision, so it ends teh loop. It should all work fine.
Oh, and btw I also changed your "for y = 10 to..." to loop up to x-1 instead of x. There's no need to see if object x collides with object x is there?
Rem Trees
position object 10,200,0,200
ht# = get ground height (1,object position x(10),object position z(10))
position object 10,200,ht#,200
rotate object 10,270,0,0
For x = 11 to 30
clone object x,10
while collision=1
rndx = rnd(3000)
rndz = rnd(3000)
ht# = get ground height (1,rndx,rndz)
position object x,rndx,ht#,rndz
collision=0
For y = 10 to x
if object collision (x,y) then collision = 1
next y
endwhile
Next x
[endwhile]
Why do you sink I ave zees outRAGEOUS accente?!