Seriously, read the original post.

He wanted to avoid writing to a file in the first place, because "WRITE" takes too long. The "example" you gave is just a bit too process intensive.

This is why my above post suggests the use of using a sorted list window /filter the nicklist into the sorted @window and then do whatever he needs to based on the @window. As far as writing to files goes, it's either /filter OR /fopen, /fwrite, and /fclose.