Once you have the client chosen, the quest::level command should work fine.
One thing I tend to do when I am testing is to use quest::say to verify if/what is being passed on or selected. So, in your case, you could do:
Code:
my $hate_target = $mob->GetHateRandom(); #this may need to be $npc instead of $mob
quest::say("My hate target is $hate_target."); #this will show if it selected someone or not and which one it selected
$npc->CastSpell(123, $hate_target);
quest::level(1);
I used a variable of $hate_target, cause I think using variables is a good way to replace certain things and to get them to run properly.