What about dumping all the lines of a text file in $sorttok dividing them by some oddball character that you know noone uses. then while loop it back into writing it sorted line by line into the file? Since your just looking to do this with nicks,
Code:
alias sortfilebyline {
  var %thefile = $+(", $scriptdirnicklist.txt, ")
  var %newfile = $+(", $scriptdirnicklist2.txt, ")
  var %lines = $lines(%thefile)
  var %i = 1
  var %data
  while (%i <= %lines) {
    %data = %data $+ $read(%thefile, %i) $+ :
    inc %i
  }
  %data = $sorttok(%data,58)
  %i = 1
  %lines = $wildtok(%data,*,0,58)
  while (%i <= %lines) {
    write %newfile $gettok(%data,%i,58)
    inc %i 
  }
  .remove %thefile
  .rename %newfile %thefile
}