How to ensure shower handle flushed when replacing shower wall to tiled wall
Before I address your question, I just want to say drywall isn't necessary.  Attach your cement board directly to the studs but put a plastic sheet in between them.  Then tile on the cement board.

Now for the valve placement, I wouldn't leave it dangling like this.  Once I figured out the correct location and depth, I put a wood block behind it, secure it to the studs and attach the pipe to wood block with brackets.

For the depth of the valve, be super careful and triple measure things. Best would be to buy your valve, cartridge, shower trim, tiles, and cement board and have them in hand.  Make a little cement board template w/ the hole, attach your tiles w/ double sided tape, and put the trim on. Account for the thinset as well.

The trim usually has wiggle room, and you can be off +/- 1/4".  Usually, when it comes to this part, I take my sweet time and take a look at it multiple times and try to imagine what can go wrong.  Once you close the walls, it's too late.

One last tip, make sure the valve is perpendicular to the wall. Else the trim will not be flush to the tiles around its entire circumference.