Well, 8 year old batteries, I'd expect aren't exactly in their prime.
You can't really judge the quality of a tool based on a consumable. That's like saying an entire make of car ***** because the tires are bald and the oil needs changing on the one you're looking at.
The 4.0Ah Li-Ion batteries are a heck of an investment for your Ryobi tools.
To the OP: Since your question was "Keep Craftsman 20V or switch to Ryobi 18V" not "which other brand should I buy" (people keep seeming to miss that), I'd put my future tool investment into the Ryobi 18V line.
I don't think you're going to recoup much on the sale of the 20V stuff, so if it were me, I'd either keep it and use it until it dies, or gift it to someone who has nothing.
Either way, I'd definitely jump all over the Ryobi stuff.
I freely admit, I'm biased, having bought heavily into the line, but the stuff really is great. A lot of folks try to claim that it's poor quality, and tout the ever-popular "real professionals use Brand X" line, but, quite frankly, that's just not that accurate anymore.
In my job, I contract out a lot of services from various high and low voltage electrical contractors, and interact regularly with generals and others.
The number of Ryobi 18V cordless tools in these folks bags/carts/work vehicles outnumbers DeWalt, which is the next most popular brand.
Knowing the Ryobi line-up like I do, I know that quite a few of these guys are using Ryobi stuff that's 5 years, 10 years old.
I don't put my stuff through the stress and rigors that they do, which, to me, means that my stuff will last even longer (and it's already lasted nearly 10 as it is).
The line is always expanding, and I wouldn't be surprised to see brushless motor stuff hit the line soon.