Two codes here: The first checks for the filename against the entries in the text file and if the filename is in the text file then the code halts.
on *:dccserver:Send:{
if $read(badfiles.txt,w,$+(*,$filename,*)) { halt }
}
The second, which I wrote after re-reading your request, checks a wildcard entry in the text file against the name of the file the person is trying to send.
Personally, based upon your request, I think the second code is the one you actually want.
on *:dccserver:Send:{
var %a = 1
while %a <= $lines(badfiles.txt) {
if $read(badfiles.txt,%a) iswm $filename { halt }
inc %a
}
}