The function you’re looking for is TIMESINCESIGNAL. Here it is in your code:
// Andy #55261 Close Above 20MA, Days
ma20 = MA(BARS=20, CALC=Close);
cond = CLOSE() CrossesAbove ma20;
//knt = MagicFormulaUsing(cond);
knt = TIMESINCESIGNAL(cond,UNIT=Days, FIRSTSIGNALONLY=False);
knt
You can show the result in a SHOWVIEW or, if you only want the number of days since the last cross you can use CHART ELEMENT, both shown in the following screenshot: