You can shorten this line:
(voice !isin $strip($2)) && (halfop !isin $strip($2)) && (op !isin $strip($2)) && (admin !isin $strip($2)) && (owner !isin $strip($2)) {
to:
elseif (!$istok(voice halfop op admin owner,$strip($2),32)) && ($3 !ison $chan) {
And add the -n switch after the writeini command:
writeinin -n autojoin.ini ...
This way mIRC will attempt to write the ini command if it's over the size limit allowed...your ini will surely get bigger over time.