The evaluation being performed using the [ ] is likely the problem. Also, I noted that you have an incorrect format in your $read line
Code:
alias count.alias {
  var -s %1 = $1
  var -s %x = $lines($1)
  var %a = 1
  while %a <= %x {
    var -s %b = $read(%1,n,%a)
    if ($chr(44) !isin %b) {
      var -s %c $gettok(%b,1,32)
      if (%c == alias) {
        echo -s alias funnet, og som første ord! >> %b << 
      }
    }
    inc %a
  }
  echo -s loop ferdig
}