Problem is probably in line 43:
var intersecting_lines = Intersects(line_fs, start_point);
What this code does (in a very general way) is this:
- get the lines that intersect the start point of $feature
- request edits to be made on those lines
- for each of those lines, goto 1
But intersecting the start point of $feature with the lines also finds $feature, so you're editing $feature and request edits to be made to $feature and it just cycles endlessly (or it would, but ArcGIS stops it).
Try adding this after line 43:
var gid = $feature.GlobalID
intersecting_lines = Filter(intersecting_lines, "GlobalID <> @gid"))
This will remove $feature from the edited lines.
Have a great day!
Johannes