How to debug custom script?

How to debug custom script?

I am trying make a script that will update Task start time when Request cusom field is changed. 
  1. var planned = await CS.getValue("UDF_DATE1");
  2. CS.setValue("scheduled_start_time",planned);
  3. CS.end();
The script is set to execute as a Form Rule, when Request custom field is edited, however it is not running or doesnt run correctly. 
Is there any way to troubleshoot the execution?

                New to ADSelfService Plus?