The thing to consider about pipe size, no matter what the medium, is the amount of flow. The smaller the pipe, the longer it will take for the machine to fill. Keep in mind that the gold standard for pipe size is copper. CPVC and PEX both have a smaller inside diameter than copper of the same size, 3/4" of these materials are about the same a 1/2" copper, so I think you might want to run 3/4" PEX rather than the 1/2". When you turn off the cold water supply to the water heater, no more hot water will enter the supply system. There will be some water left in the pipes but will drain if you open the pipe at the low end and the top end of the system. Using CPVC you would want the pipe ends dry where you make you joints, I don't think that's as critical with PEX.