Using $$2 means use $2 if it is there, else stop the script completely. You don't want this here. You don't want this often.

mIRC does not recognize ' or " as a string delimiter in most cases (only some file and window commands have their own parsing for that.)

Don't halt unless you really need to, the most common (and thus best) way to have a script stop is by having it reach the end of the script, in other words the last }

/set is not needed if don't need the %variable after the script ends.

You didn't close the ) in the $read() call. I'm also not sure why you want to search either file for the word !beer since that is $1. I suppose you just want a random line out of that either text file. Please let us know if the text file really has lines with nicks already filled in or if you want to include either the given or the requester's nickname in the line somewhere.

Here's a changed simple version
Code:
on *:text:!beer*:#:{
  if ($2 == $null) { 
    msg $chan $read(drinks.txt)
  }
  else {
    msg $chan $read(beernick.txt)
  }
}


Maybe search this forum for other scripts like this, such scripts can get much more complex for all kinds of situations. Make sure you set the date range to 5 years.