ive never seen raw 822, so i dunno the syntax of it
basically what you need is (im just gonna assume that $2 is the nick of the person going away, if not -> just change that)
Code:
raw 822:*: {
  .timerawaywk1. $+ $2 1 120 notice $2 Do not idle in #yourchanhere
  .timerawaywk2. $+ $2 1 300 notice $2 Last Warning
  .timerawaywk3. $+ $2 1 420 kick #yourchanhere $2 Dont go away..
}

you also need events that will stop the timers if he parts/quits/comes back from away

heres a start
Code:
on *:part:#yourchanhere: {
  var %i = 1
  while ($timer($+(awaywk,%i,.,$nick))) { 
    $+(timerawaywk,%i,.,$nick) off 
    inc %i
  }
}

on *:quit: {
  var %i = 1
  while ($timer($+(awaywk,%i,.,$nick))) { 
    $+(timerawaywk,%i,.,$nick) off 
    inc %i
  }
}


i dunno the raw for coming back, so youd have to do that on your own, but that should be possible given this start =)