Use Z probe to find center of 4th axis and z zero position

I seen a video on youtube where a guy uses his z probe to find center and set z zero with his z probe of his 4th axis, looks like for a Vortex CNC. I would love to be able to use this to find the center position and zero my z axis with a z probe like in this video, but with marlin. Would it be possible to write a script that sets the y zero(my 4th axis runs parallel with my x axis) by probing in a Y direction but using the z probe as min max y endstops, and then setting the center of those two points to y zero?

here is the video to clarify what i would like to be able to do with marlin somehow…
probing is at 10sec to 17sec of this video

so. do they list the gcode for their homing? It is probably fairly simple to do.