That will work fine if you have defined what race1, race2 and race3 are somewhere.
You could make it like this
if ( ch->race != get_pc_race( "human" ) ||
( ch->race != get_pc_race( "elf" ) ||
( ch->race != get_pc_race( "dwarf" ) )
Well whatever race name you want where human, elf and dwarf are, that should work.