Inserting helicoil

Hi,

I’m currently working on a script that can do the following tasks:

  • Insert a helicoil below at certain depth below the surfuce of the product.
  • Apply a determined force on the helicoil while inserting.
  • That stops inserting the Helicoil after a determined amount of trys if it fails to insert the helicoil.
  • That unscrews the mounting mandrel after the helicoil is installed correctly.

I’ve come up with the script that can be found below:
The script is not running correctly, it keeps getting stuck at the screwdriver action in if else loop.

Thank you in advance.