I'm not sure why this is happening, and I don't see anything wrong with your code. Here, however, is an alternative code that I think should work (I don't have a file that size to test it)
Code:
alias doit {
  if !$hget(classes) { .hmake classes 5000 }
  if $exists(stupid.txt) { .hload -n classes stupid.txt }
  var %i = 1, %lines = $hfind(classes,General Education Course:*:*,0,w)
  while %i <= %lines {
    var %line = $hfind(classes,General Education Course:*:*,%i,w)
    echo -s Line: %line $+ : $hget(classes,%line)
    inc %i
  }
}