Here is the script code I use and it has always worked for me.
My plate is 1.5mm and it retracts 10mm from the plate.
I did notice that I have a line different to yours. I've highlighted it in red.
Maybe mine isn't correct, but it works.

CurrentFeed = GetOemDRO(818)
PlateThickness = 1.5
If GetOemLed (825)=0 Then
DoOEMButton (1010)
Code "G4 P2"
Code "G31 Z-5 F100"
While IsMoving()
Wend
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePosWhile IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.25"
Code "G0 Z10"
Code "(Well done the Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If