Figure.1 : This script adjusts dashed lines in the selection in order to the center of the first dash comes at each anchor points.
For its purpose, when adjacent segments of an anchor of the target path have a difference in length, a rectangle like above, for example, this script splits the path at this anchor, applies a suitable dash setting for each split path, then put them into a group. This is a lockstep trick caused by an Illustrator path can have only one simple rule for dashes and gaps. This process also CLEARS FILL COLORS, if it needs, and if the pash has BUTT end cap, change it to PROJECTION end cap.
Figure.2 : The left figure is split with pathfinder ( outline ), in order to make anchors at all intersection points.