Well there's a couple possibilities, would be helpful if you posted the whole script.
GetEquipedObject is an OBSE function. I'm assuming if the script compiles properly that you know this and are launching both the cs and the game with the OBSE launcher.
Slot 20 is for armor that fills the lower, upper, hand AND foot slots like the DB armor, if your NPC isn't wearing armor that does that you wont get a result returned.
How and where in the script are you filling the "who" variable, if this is happening after the armor check or not working properly you're checking an empty reference.
If none of the above helps, post the whole script and we'll have a look.
WT