Please include the code within the body of your question or as an attached plain text file. The share links generated by Thinkorswim have an expiration date and they can be revoked. They are not suitable for posts in a Q&A forum that will persist for years.
In your request it seems you gave the same conditions for when the label should display YES as well as NO. So I will take that as a typo and provide a solution so that the label displays YES when close is greater than hl2 and NO when the close is less than hl2.
Here is you code, cleaned up a bit to make it easier to read and remove some unused lines. I have added only one line of code to produce the label you requested.
input aggregationPeriodForHL2 = AggregationPeriod.FIVE_MIN;
def highValue = high(period = aggregationPeriodForHL2);
def lowValue = low(period = aggregationPeriodForHL2);
plot hl2 = Round((highValue + lowValue ) / 2, 2);
hl2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
hl2.SetStyle(Curve.FIRM);
hl2.SetDefaultColor(CreateColor(255,255,255));
AddLabel(yes, Concat(“HL2 : “, hl2 ), Color.WHITE);
AddLabel(yes, if close > hl2 then "YES" else "NO", Color.WHITE);