As far as I know, Anselm's argument for the existence of god goes like this:
Let's imagine the most perfect being possible. If we imagine it being most perfect but not existing, it would be even more perfect if it existed, which causes a contradiction. So imagening the most perfect being makes it logically impossible to assume it does not exist.
Let's ignore the often discussed locical problems of this reasoning, and focus instead on the possibility that the same argument could be recycled for a god that is not perfect but perfectly evil.
The argument would then be: I imagine the most evil god I can think of. If you define evil as the ability and inclination to cause harm and suffering, that ability would be obviously greater for an existing than for an non-existing god. Therefore imagening the most evil god would logically force me to assume he exists.
(If you wish, you could replace "evil" with similar attributes like destructive, threatening, scary, cruel, harm-causing, all-hating etc.)
The conclusion obviously is in contradiction with Anselm's.
One could even claim it is in contradiction with itself, since the most destructive or cruel god would already have destroyed the universe, or made our past life full of torture. (Even if some persons might be justified in claiming their lives could not have been more unhappy, I suppose for at least some of us that is not true, which should be enough to exclude the "perfectly" cruel god. Or is he just biding his time?)
A possible objection would be that "perfect" is somehow an intrinsic attribute, but "cruel" or "evil" are only human evaluations, and "destructive" makes only sense in relation to something else. But what about "all-loving" or "all-good", which are often claimed as intrinsic attributes of god (though not in this exact context)?
My question is: Has an argument like this ever been suggested in philosophic literature, and are there arguments for/against it which I did not think of? Especially, is there a way to defend Anselm's argument but refute this one?