If you're comparing two floating point values for equality, you definitely shouldn't just == them. You can do Math.Abs(A-B)<0.01 if you want to limit it that way. Easier than rounding them up and would take care of the case where one rounds up and the other rounds down.
And yes you can do ONE plot per paintbar, for anything you want. That's the SetYValue function (in general, this page:https://www.medvedtrader.com/trader/WebHelp/advanced_-_all_available_funct.htm will probably be very helpful).
So if the 50SMA is called SMA50 - you can just do these two lines:
SetColor("% diff",Color.Lime);
SetYValue(100*(SMA50-Close)/Close);
You'd need to place this paintbar on the extra chart - either above or below the main one. And probably set the shape for the paintbar to size 1 so that the shapes do not obscure the line.