In grammatical theory, for theories based on hierarchical tree structure, No, because presumably grammatical functions correspond to the descending lines of a tree diagram, and no two lines can converge, allowing a single item to be the daughter of two different mothers. I know of two theories which do not require strictly hierarchical trees and which do allow a single item to have two different functions.
One is Relational Grammar (and Arc Pair Grammar), proposed by Paul Postal, David Perlmutter, and others. However, although it is proposed in this theory that some tree branches converge, I don't know that evidence has been given that this is actually so.
The other is McCawley's variety of transformational grammar, described in his textbook The Syntactic Phenomena of English, which includes an explicit account of a modified phrase structure theory that sanctions converging (and crossing) tree branches. Specifically, McCawley proposes that the raised node of right-node-raising (RNR) constructions simultaneously has grammatical functions in both of the conjuncts to its left. So, for instance, in
John built, and I installed the stove of, the new kitchen.
the raised constituent "the new kitchen" is simultaneously the direct object of "built" and object of the preposition "of".
McCawley does give some evidence for his theory of RNR constructions that is based on how the CNPC constraint works in some rather complicated examples, which I cannot recall in detail.
Best Answer
Both sentences are grammatically correct in that you've used the correct whoever/whomever in both. Break each sentence into two:
But the meaning differs between your two sentences. In the first you are saying you will kill people you despise. In the second you are saying you will kill people who despise you. Which is it?
Also, if you're a high school student in the US I wouldn't let my teacher see this.