Not used rebirth yet, but i would do it this way.
On your rebirth npc, make it set a flag. Example
#ACT
SET [100] 1 For warrior
SET [101] 1 For wiz
SET [102] 1 For tao
Then in Qfunct put this.
[@logon] or [@login]
#IF
CHECK [100] 1
#ACT
Setrank blah blah, forgot command
break
#IF
CHECK [101]...