i am also having this issue with the pause at layer script.....i have no idea how to modify G code...all i know is, i used this script all the time for changing filament colour with no issue.....now every time i use it the nozzle lowers and hits my print leaving a big gouge in my print, and destroys the probe on my BLtouch as it drags on the print...
please fix this as it it clearly a software bug......