I always have great luck replacing grip shift cables right up until it says, "Feed new cable through." Yeah, right.
I will usually leave the unit bolted to the bar and just yank off the twisty part. Have it in the high gear/cable all the way released. Pay attention to how the cable is run as you are pulling the twisty part off the rest of the unit. Pull the old cable out, thread the new one on like the old one was, jam it all back together while pulling the cable slightly from where it comes through the adjuster. Only thing to be careful of is the metal indexing spring--when pulling it apart, note where the spring goes so if it comes out, you know how to put it back together.