I don't understand why you need extra field in players table, nor script, which, afaik, may cause some unecessary load due to query you've placed in it.
Everything can be done with a single query through the deaths recording system.
Code:
SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags`
FROM `killers` k
LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
WHERE `k`.`unjustified` IN (1,3)
GROUP BY `name`
ORDER BY `frags` DESC, `name` ASC
LIMIT 0,30;