First off,
Your use of lindex is improper at best; this command expect the first input to be a list, just like lrange. Further, lrange returns a list, not a string, so you'll want to convert it back into a string using join.
Next, you'll need to add a test to see whether the user supplied both arguments or not. You could either do this by testing if either $nick or $reason is the empty string, or test the number of elements in $arguments - after you've converted it into a list; if this is less than 2, atleast one argument is missing: