There is no command that returns a unit rank, The only thing you can do is to name every enemyunit and put them in an array, like
_majors = [m1,m2,m3,m4]
_colonels = [c1,c2,c3,c4]
etc...
Then give each of them a killed EH and check the arrays :
_killer = _this select 0
_casualty = _this select 1
_killer = _casualty : exit
?_casualty in _majors : _killer addrating 300
?_casualty in _colonels : _killer addrating 500
exit
Not tested.