As long as you are not set for exact stop mode, your code should give smooth motion in Y. You may have to experiment with the P and Q parameters of the G64 command to get the results you want.
See
linuxcnc.org/docs/html/gcode/g-code.html#gcode:g61-g61.1
for more info.