You'll have to wrap the code that creates the file in an IF statement so that it doesn't create it if it already exists.

 Code:
Break on

If Not Exist("Sometextfile.txt")
   ;Open text file. Create it when it does not exist.
   $rc = Open(1, "Sometextfile.txt", 5)

   ;Get last three characters from @wksta.
   $hostname = Right(@WKSTA, 3)

   ;Write to text file.
   $rc = WriteLine(1, $hostname)

   ;Close text file.
   $rc = Close(1)
Endif