An ability is an integer, so for example:
Banish = 'AHbn'
and
'AHbn' = 1095262830
So if someone typed "1095262830" and then you did UnitAddAbility( S2I(GetEventPlayerChatString(), unit)
then it should add that ability.
However, there's no reason to do that because you can just have the player enter something much more simple, like the ability's name. Then check the ability's name and return the ability id, which is the integer, then add it. You would probably need a hashtable unless you're only going to be using a few abilities, then you could easily do if Entered chat string = "banish" then add ability banish to unit