Ready scripts out there available, one is bans which isn't quite the best option but still a starting point if you like.
there's also wpbans which is a wordpress plugin for bans that grabs items matching a post title, a custom field, or the top categor in the heiarchy.