About the Illegal to sell it thing.
The loophole is to make it that they are paying you for the time and effort invested in the character, and you are giving them the account for free.
It does not howver get past the sharing accounts thing in blizzards EULA.