Post your whole script.
When you say you "declared" your formlist, do you mean to say you made a property (and filled that property in the CK). You do need to make a property to the formlist in order to use it. You do not have to make race properties for the HasForm to work. Here are a couple examples below...
This code works fine and compiles.
Formlist Property RacesBeast AutoFunction SomeFunction(Actor akTarget) Race kTargetRace = akTarget.GetRace() if RacesBeast.HasForm(kTargetRace) ;do stuff endIfendFunction
This code does not work. Although the Argonian race is in the formlist, papyrus cannot see it.
Formlist Property RacesBeast AutoFunction SomeFunction(Actor akTarget) Race kTargetRace = akTarget.GetRace() if kTargetRace == ArgonianRace ;does NOT work - argonian race undefined ;do stuff endIfendFunction
This code works because we used the GetAt function and the respective index to get the Argonian race
Formlist Property RacesBeast AutoFunction SomeFunction(Actor akTarget) Race kTargetRace = akTarget.GetRace() Race ArgonianRace = RacesBeast.GetAt(0) as Race if kTargetRace == ArgonianRace ;do stuff endIfendFunction
Hope that clears some stuff up. But again, posting your whole script rather than a fragment is very useful 
Also, you can name your properties and variables anything you'd like - they don't have to match the CK name. The only advantage of using the exact CK name for properties is that you can auto-fill them.