a few issues.
1. when you post code, it's a lot easier to read if you've clicked on the hashtag icon to surround that with the code tags. You can click preview to see what it would look like.
2. You should get in the habit of always using the 'nt' switches unless you specifically don't want them. If you use 't' and the 1st line is a number, it uses that as the count for the number when reading a random line, and won't return a line after it. Also, if the 1st line is a number, not using 't' can return an unexpected line. If your test.txt file has 3 lines:

999
888
777

$read(test.txt,n ,2) returns 777
$read(test.txt,nt,2) returns 888

'n' prevents a word beginning with $ or % from being evaluated as an identifier or variable. If your script displays the last thing someone 'said' in channel, and it contained a $word or %word, you can display some undesirable info or take dangerous actions. I know this script won't have line1 being entirely numeric, and you're not writing %word or $word, but the next script might.
3. In your ontext event, you're assuming that $2 has been seen, but if they haven't, your message will have the $read returning $null. You should put the result of $read into a local var instead, then tailor your message into 2 alternatives, depending whether the read returned $null or not.