Flow Control in CSH

hi ,
I am new to scripting, i have a doubt can any one pls solve it for me
the code is not working

set users = (user1 user2 user3)

echo The users are
echo $users
[*]
echo Enter the USER NAME 
set USER_NAME = $<
set i = 1;
for ( i = 1; i <= $#users; i++ )
if ( $USER_NAME == $users ) then
mkdir root/project/$USER_NAME
else echo INVALID USER!!!!
endif
done

this is not working... how do i check whether the users are valid or not... and ask again to enter the users if the input is invalid...

You are mixing syntax of csh with sh/bash elements.
Exclamation marks in strings need to be escaped because of their special meaning in csh.

#!/bin/csh
set users = (user1 user2 user3)
echo The users are
echo $users
[*]
set found = 0
while ( $found == 0 )
  echo Enter the USER NAME 
  set USER_NAME = $<
  foreach user ($users)
    if ( $USER_NAME == $user ) then
      echo mkdir root/project/$USER_NAME
      set found = 1
      break
    endif
  end
  if ( $found == 0 ) then
    echo "INVALID USER: $USER_NAME \!\!\!"
  endif
end

But possibly it is a better idea to learn ksh/bsh/bash scripting.
csh and tcsh are good for interactive working, but not so much for scripting.
Have a look at Advanced Bash-Scripting Guide