on me:*:JOIN <- not correct syntax see /help on join
$chan(%chan,0,r) <- see /help $chan
The above is what I noticed at a glance.

try this: (untested)

on *:JOIN:#help:{
if ($me isop $chan) { return }
else { timeridle 1 540 part #help }
}
on *:input:#help:{
if ($me isop $chan) { return }
else { checkidle }
}
alias CheckIdle {
timeridle off
timeridle 1 540 part #help
}
I know its not the best example, or best way to go about it, but it should work and give you a little to work with. smile

-cheers