No need to use $ticks for this.
Here's a quick example of how you could do this.
Code:
on me:*:join:#:{
  set $+(%,join,.,$network,.,$chan) $ctime
}
on *:text:*:#:{  check_join $chan }
on *:action:*:#:{  check_join $chan }
on *:notice:*:#:{  check_join $chan }
alias -l check_join {
  if $calc($ctime - $($+(%,join,.,$network,.,$1),2)) >= $duration(1 week) {
    .msg $1 I've now been in $1 for 1 week or more consistently.
  }
}


If this is not sufficient for you to amend for your specific purposes, reply back with more details and we'll see what we can do to help.