I think this should do the trick. I only had to copy the if/then/else statement from the section of the AddLabel statement that controls the color of the label. I have only tested this for errors and did not check it for accuracy.
input length = 14;
input averageType = AverageType.WILDERS;
DefineGlobalColor(“DI+”, color.green);
DefineGlobalColor(“DI-“, color.red);
DefineGlobalColor(“Neutral”, color.gray);
def ADX = DMI(length, averageType).ADX;
def DIp = DMI(length, averageType).”DI+”;
def DIm = DMI(length, averageType).”DI-“;
plot row = if !IsNaN(close) then 0 else Double.NaN;
row.AssignValueColor(if ADX > 20 and DIp > Dim then GlobalColor(“DI+”) else if ADX > 20 and DIm > DIp then GlobalColor(“DI-“) else GlobalColor(“Neutral”));
row.SetPaintingStrategy(PaintingStrategy.POINTS);
row.SetLineWeight(3);