Should be able to switch out the gear recognition assembly without so much as a code; as far as the shifting problems, they have had several updates on that transmission, and you have valve body,
VB electronics (conductor plate), and control module (TCM) that can affect your shift, plus the various electronic inputs going to the TCM, and the mechanicals itself. Start with pulling the codes, and if nothing significant comes up, have the TCM adapted (shift values erased and reprogrammed), and definitely have your fluid quality checked (I.E. regardless of what you hear, make sure the fluid is changed every 50-60K miles, ESPECIALLY on your older style tranny; they have 6 major updates on the tranny mechanicals alone on that since yours was built, and it's just a ticking time bomb IMO).
You cannot switch out the TCM without version-coding it first, but if you are buying it new or rebuilt, the supplier will automatically version-code it for you; they will need your VIN# to do it. There is an updated TCM, 0265450832 or something like that, so whatever module you buy, make sure it starts with "026", as I believe all the updated modules do. And yes, as long as you buy from a dealer and know how to adapt the vehicle (adaptation is a driving procedure to set the base settings on the transmission; it has to be done a certain way, but if you mess it up it will still drive, and eventually reset itself close to where it needs to be), you can replace it yourself. The new or rebuilt transmission control unit comes with no adaptation values, so when you put it in you will need to know the procedures to set the adaptation values (I'm sure they're somewhere on this forum).
I will hopefully be setting up a reseller account (as opposed to a wholesale account) for transmissions with a dealer, so the minimal discount I get for purchase of transmission can be doubled, and I can reflect the savings on to people such as yourselves. I think, however, if the members of this forum and other forums complained enough, the transmission would be made available at a greatly discounted price to begin with, as much of the problems are directly associated with dewign flaws inherent with rapidly designed major automobile componants. The reason it won't happen is the vast experience and knowledge it requires to even understand how these transmissions work and what specifically it is that goes bad on them is not within the realm of the common driver. But ask any of the major aftermarket Mercedes transmission rebuilders, and they will tell you the transmission has received major updates because of inherent weaknesses within the transmission; I would think that if MB could be made to extend the M111, 112, &113 warranties because of faulty lubrication schedules (even though it was related to using dino instead of synthetic fluid in many cases), some headway should be able to be made with the non-existant service intervals with the 722.6 series transmission, because the fluid breakdown and resulting friction in the center of the transmission is a primary reason of catastrophic failure of the center planetaries (primary cause of transmission failure), namely the center planetary support.