Quite correct on all points, but the question wasn't "is ad hominem ever logical?" it was "is ad hominem ever valid?" It is valid, if illogical, in certain circumstances. Flame wars come to mind, you pedantic mongrel taffy-loving... erm... something that is spelled without vowels. Maybe Phllygm.
It depends on what you mean by 'valid' though. Everytime I see the word valid used in this sort of context (discussing arguments, fallacies, etc.), I immediately think of its meaning in formal logic. In that sense, ad hominem is never valid, as it has the form, "P asserts Q; There is something undesirable about P; Therefore not Q."
Having said that, I'd still say that ad hominem arguments are never valid, in any sense of the word - the whole point of an ad hominem is to attack the person asserting the proposition and not the proposition itself. In a situation where it would be reasonable to call into question the character, actions or motives of the person asserting the proposition the argument is no longer ad hominem, instead it turns into an argument with a series of commonly understood, but hidden, premises.