If you used SAS/IML, the SAS code could be even smaller. See Rick Wicklin's approach here.

And if you use PROC SGPLOT instead of GPLOT, you'll save even more lines.

proc sgplot data=work.cumstats;
spline x=i y=pctnever / lineattrs=(color=green) ;
spline x=i y=pctswitch / y2axis lineattrs=(color=red) ;
yaxis max=1.0;
y2axis max=1.0;
run;