How much of a damaged shower wall should I replace?
Yes, you want to square off the drywall so your cement board will fit snug so as to lesson the amount of repair to do. Use cement board mesh tape to do along joints and any where the tile meets a joint. 

Down on the bottom is that dark area the shower pan? If so make sure it is behind the cement board so it doesn't leak. The area you had to use tape you now want to take some thinset mortar and using a 3/16 notched glue trowel, take the flat side and smear thinnest along the seam to fill in joint so you won't have a leak. Be neat and as flat as possible--you don't want up and down tiles! Let that set over night and next day if you have a sanding stone go over any rough areas with it before starting repairs. 

You will use thin set (no latex) to attaché tiles to cement board. When you are done allow overnight to dry. Also clean any thinset on tile or stuck in grout joint. Use a utility knife to clean joint and clean with moist sponge. 

Next day it is time to grout. You want to take a sample of your old grout and try and match it at your local big box store or a tile store. Do the best you can. To grout you will need a grout float a margin trowel and it looks like unsanded grout. Mix grout with margin trowel to the consistency of peanut butter. Smear grout on wall with grout float. Use float on a 45 degree angle to work grout into grout joints.scrape excess off with float and allow grout to dry for 10to15 minutes. You will see the grout haze over on the tile and this means it's time to wash off. Take a damp sponge and wash over grout joints on a 45 degree angle. Take sponge and wash out in clear water. Now take sponge and make one pass straight down, turn sponge over and make one more pass over dirty tile. Now rinse sponge out in rinse water and repeat whole process over until whole wall is clean. Change water after you finish and wash again in 2 hours. 

Good luck. 
Mike