Yuck, a goto loop
![sick sick](/images/graemlins/mirc/sick.gif)
I also can't see exactly why your code would be a having problems, although changing this might help.
; placing an echo line here might help debug this???
echo -s Read from file: %chan
; Change this line
join %chan
; to...
if (!$chan(%chan)) join %chan
Also, you can completely remove this code. Logically this behaviour is implied. Since you are using goto prior, the else isn't needed, and since you are not returning an actual value, return is not needed. Just trying to save you a few lines of code...
![smile smile](/images/graemlins/mirc/smile.gif)
Edit: If this is being done after connecting, mIRC might be trying to auto join the channel at the same time, check your Channels List.