Code:
on *:MODE:#Script-testing: {
  /notice $me $nick changed $chan mode to $1 at $time | write log.txt $me $nick changed $chan mode to $1 at $time
  if ($1 == +i) { /kick $chan $nick DO NOT Change The Modes Of The Channel $knick $+ !! | /mode $chan -i }
  else { /mode $chan -i | /mode $chan -m }
}


You Will Notice The { } around the else statement now, also you had a } after the write log.txt.... line, its not needed, and you needed a bracket down the end to close the event statement

also i dont understand the logic of your else statement.

Back To Your Original Question which was to stop people from changing the modes, and kicking them if they did, you might want to look at the script i posted above.