$readini(mirc.ini chanfolder n $+ %i }

This is close, but n ot quite. Read the mirc help file on $readini and make sure you close any open brackets. That includes { }, [ ] & ( )

Also ... I dont know, maybe Im missing something, but you start with %i = 1.

then you say...

while (%i > 10) {
(while 1 is greater than 10)
1 isn't greater than 10 so I don't expect it would do much. If it did by chance get to 10, look out because you will get a recursive while loop.

Maybe you meant ...

while (%i <= 10) ?