@wariofart: It's kind of a customary thing around here to create an account and introduce yourself if you want help with a problem. That is why alexrudd responded like he did.
On to your questions…
Your first question is actually rather ambiguous, since you say you want it to move in a random direction, and at the same time you say you want it to come back if it reaches the edge of the screen. This makes me believe you just want it to get the initial direction randomly, and then use that from then on. Is this correct?
As it turns out, moving a ship randomly on the screen is not too difficult, and just involves using some variables to keep track of the directions (up/down and left/right). Here is a simple example:
:ClrHome
:DelVar S4→X // direction | X coordinate
:DelVar T4→Y // direction | Y coordinate
:Repeat getKey
:Output(Y,X,"X
:If dim(rand(10 // short delay
:randInt(1,4→A // 1=DN, 2=UP, 3=RT, 4=LT
:(Ans=1)-(Ans=2→S // X coordinate
:(A=3)-(A=4→T // Y coordinate
:Output(Y,X," (1 space)
:S(X>1 and X<16)+(X=1)-(X=16→S // enforce the screen boundaries
:T(Y>1 and Y<8)+(Y=1)-(Y=8→T // enforce the screen boundaries
:X+S→X:Y+T→Y
:End
I'm going to hold off answering your second question until I get an answer on the first question.