after the if statement, if the member was found, you can simply replace the
msg # $2 found
with
write $+(-dl,$readn) members.txt