You used the word days but in reality this measures bars. The only time this would measure actual days is if you set the custom column to daily time frame. But for most users, the VWAP chart study is used on an intraday basis, so the count is going to show the number of bars above or below the VWAP and not the number of "days".
Please note in this solution I am breaking from my typical policy of using the full source code from the built-in chart study. The reason for this is that code is well over 24 lines so in this case I will reference the study rather than include the full source code from the original. This is less than ideal so for any solution that requires absolute control over the end result I always recommend using the full source code from the original rather than just a reference to the chart study.
input numDevDn = -2.0;
input numDevUp = 2.0;
input timeFrame = {default DAY, WEEK, MONTH};
def vwapValue = reference VWAP(numDevDn, numDevUp, timeFrame).VWAP;
def crossAbove = close[1] < vwapValue[1] and close > vwapValue;
def crossBelow = close[1] > vwapValue[1] and close < vwapValue; rec countBarsAbove = if crossAbove then 1 else if close > vwapValue then countBarsAbove[1] + 1 else 0;
rec countBarsBelow = if crossBelow then -1 else if close < vwapValue then countBarsBelow[1] - 1 else 0; plot data = if countBarsAbove > -countBarsBelow then countBarsAbove else countBarsBelow;
data.AssignValueColor(if data <> 0 then Color.BLACK else Color.CURRENT);
AssignBackgroundColor(if data > 0 then Color.GREEN else if data < 0 then Color.RED else Color.CURRENT);