It is a balancing act but that's not why. A weak yuan promotes internal consumption in China for the same reasons it promotes US consumption of Chinese goods.
But once the yuan is weak enough that manufacturing does move to China, making it even weaker is only throwing money away. It's like selling below cost to drive competitors out of business -- if you can drive them out of business by selling for $1 below cost then there is no reason to sell for $2 below cost. Otherwise they would just print a trillion yuan every day.
Also, prohibiting foreign takeovers doesn't increase the value of the yuan, it only solves the "problem" of a weak yuan encouraging foreign takeovers. If Chinese companies can no longer be bought and they're traded in yuan then that will only reduce demand for the yuan.
> The yuan has fallen to its lowest level against the dollar since 2008; anxious Chinese officials are said to be pondering tighter restrictions on foreign takeovers by domestic firms to stem the downward pressure.