Pascual,
Do not allow 'G0' RAPID below safe retract plane. Set parameters 'free-feed' and 'retract' to 100. The NC machine control determines most efficient 'G0' path. I think this is standard in most CNC mills. 'G0' moves in the desired direction but locks onto each axis as the path intersects...