If statement need spaces between the keyword and the condition, the opening bracket also need to be on the same line if used, you don't need them in that specific case though since you only have one command for each if.
Also, you can use ban -ku300 to kickban and auto-unban after 5 minutes, avoiding the notice to yourself :
on !1:text:*word*:#mychan:{
inc %derek
if (%derek == 0) {
msg $chan 4Please $nick $+ , do not use such language in here.
}
elseif (%derek == 1) {
msg $chan 4Please $nick $+ , do not use such language. This is the channel's final warning before someone gets kicked.
}
else {
msg $chan 4Goodbye $nick $+ . You have been warned. Your ban will lift in approximately 5 minutes.
ban -ku300 $chan $nick 2
}
}
Fixed some minor things too.