I would first try removing the IN clause as the replace needs to occur in the work area being scanned. Also you can reduce the replaces to a single line as I show below.
SELECT *,SPACE(8) as nafseq2 from znaf INTOTABLE datax\znaf2
seq=8950
SCAN
seq=seq+1replace nafseq2 WITHALLTRIM(nafseq), ;
nafseq WITHSTR(seq,8)
ENDSCAN
When this is run what is in the nafseq2 field of the table znaf2?