i dont like this way because its look to complex for this base comand(do not forget
i need to remember the curent speed ,then put them again while condition pass ,so its become much complex ,and
as i mention its not only before homing its also in some other cases
so then i got what mach warning against ,try avoid heavy on plc script
but also other much more problem for me its that the jog command as i copy from yours sample not turn to "0"
in my laptop