Code Request to Update Task Dates On Changes to Subtask Dates

Code Request to Update Task Dates On Changes to Subtask Dates

I would like to create a snippet of Deluge that executes when Start or Due Date is changed on a Task... 

Basically this... and vice versa for End Date.. if the Subtask dates are changed to extend beyond the Parent Task Dates, automatically update the Parent Task dates.
  1. If (SubTask.Start_Date < Task.Start_Date)
  2. {
  3.       Task.Start_Date == SubTask.Start_Date;
  4. }

Question 2: Can code be run if the dates are edited in the Gantt view? Team will be working in Gantt view and I would like the Parent Task to update in real time as they are dragging the dates for the Subtask.

Also, I am aware there is standard functionality to do this with Roll-Up Projects, we do not want to use this feature as we do not want Task dates to always roll-up to Projects & Milestone dates.