Answer:
The numbers do not have to be stored and the counter is also unnecessary, so take out all lines with PosNum[], NegNum[] and Count.
The repeat...until clause can be changed to:
REPEAT
...
UNTIL Number = 9999
and the IF Number>0 THEN must be changed to
IF Number > 0 AND Number != 9999 THEN
That should do the trick.