Homing_retract_dist and sensorless homing

Almost there with my settings, I am now trying to find a “non macro” solution to this issue:

I am using sensorless homing, so homing_retract_dist is not an option, now, when Homing XY or Homing All, I would like the X axis to move by 10-15mm after “hitting” the virtual endstop, to prevent him of flirting with the Z axis rods and ledscrew support when travelling his way to home Y.

Where and how can I modify this (I am using Klipperscreen).

Thanks for helping!

See
https://www.klipper3d.org/TMC_Drivers.html#using-macros-when-homing

So, here is the code i came up with with my poor Gcode skills:

[homing_override]
gcode:
#Lifting Z by 5mm
    G1 Z5 f1000
#Homing X
    G28 X
#Moving X by 10mm to avoid stepper
    G1 X10
#Homing Y
    G28 Y
#Homing Z
    G1 x140 y140 f3000

[safe_z_home]
home_xy_position: 140, 140 # Change coordinates to the center of your print bed
speed: 50
z_hop: 10                 # Move up 10mm
z_hop_speed: 5

Two questions:
will this code do what it is suppose to do (no syntax errors)?
will it override the [safe_z_home] section?

update:
I had to comment the safe_Z_home section as i had an error message, now, when I try to home, error message:

Must home axis first

I think what you want to do is (not tested!):

[my_home_x]
gcode:
    G28 X
    G90
    G1 X10
[homing_override]
gcode:
    my_home_x
axes: x

Quite clear: You cannot command any gcode moves until the printer is considered fully homed. You can force it, but be aware that each and every safety mechanism are not in place and, e.g. if your bed is already fully down, it will do the Z move regardlessly.

Sorted the problem this way, until I find a better solution!

[homing_override]
set_position_z: 0.0
gcode:
#Lifting Z by 5mm
    G1 Z5 f1000
#Homing Y
   G28 Y
#Moving X by 10mm to avoid stepper
#  G1 X10
#Homing X
   G28 X
#Moving to center of the bed
   G1 x140 y140 f3000
#Homing Z
   G28 Z