RAW 474:*:{
if %setUnbanJoin != 1 {
cs unban $2
join $2
set -u5 %setUnbanJoin 1
}
}
Untested.
That should work without needing a while statement. You can also do this using groups, but I find them annoying to use. You might be able to pick a smaller number for unset, but it needs to be greater than your average ping.