Can I just point out that my house has a GAS pipe embedded in a wall? Whenever I've had a gas safety inspection the attitude has been that it's not to current standards but, as it isn't leaking... and it's been there at least 35 years. Realistically, while it's entirely possible your pipe will start leaking tomorrow, it's equally likely to continue to serve its purpose for another 50 years. If the wall is dry, I doubt any chemical reaction with the pipe will be a quick one, and if it's old imperial pipe then it's likely to be thicker than modern pipe anyway, so will last a while...
If, however, you like the idea of the pipe being replaced, then there aren't any particular rules about where pipe runs should be. Just don't bury any compression joints. Don't bother trying to remove the existing pipe from the wall in order to sleeve it. Either use it as it is and bypass it should it ever start to leak, or bypass it now and leave the redundant pipe disconnected in the wall.
One rule you should be aware of is that dead legs (dead ends of pipe that don't have water running through them but that are still under pressure) teed off a pipe must be removed to within a pipe's diameter of where they tee off, or, ideally, be removed altogether. This is to prevent stagnation of water and breeding of bacteria. So if you want to bypass the old pipe, you need to make sure you entirely disconnect the redundant length.