Assuming your text file looks like

nick1 reason for nick1
nick2 reason for nick2
...

... then %NaughtyList contains the text you want to display.

Other things to fix with your script:

(1) The "var %t = $lines($txt)" should go below the line checking to see if the file size is zero
(2) You should always be in the habit of using the nt switches with $read except when you specifically want it to use a possibly numeric line#1 as if it's the number of lines in the file, and/or when you specifically want it to evaluate $identifiers and %variables found in the text file. Your script does not do any kind of authentication before writing to the text file. All that's needed is for someone to enter the specific channel and to type the triggering command, or for someone to trick you into typing a specific command.

If the line contains

nick1 test %password $asctime test

... then %NaughtyList will not contain %password, but would instead contain the contents of that %variable if any. It would evaluate $asctime at the moment when the $read command is executed, not containing the time when the file was written and not containing the literal word beginning with the dollar.

There are a lot of bad things that people can do to you if they can get you to write specific $identifier strings to a text file then get you to later $read that text from disk without using the 'n' switch.

If line#1 turns out to be numeric, though it wouldn't be in this case since nicks can't begin with a number, then that number would be used to limit how many lines of the text would be used. If line#1 was 10, then $read without the 't' switch would behave as if the line has only 10 lines following line#1, and would ignore everything beyond that.

(3) You're using the 'n' switch in your "!viewlist" trigger, but you're doing this inefficiently, instead of looping through an X lines text file X times and messaging the lines 1 at a time, you could instead do:

play $nick $qt($txt)

Note that this method avoids evaluating $identifiers in the displayed text. If you were not wanting to display the entire line, then the /play command couldn't be used without using its -a switch to have an alias which modifies the output before messaging it.