What can be done to save an old macbook?
This is hard to guess, as you can imagine. If the machine had kernel panics the usual (but not only) suspects are RAM chips. You can probably try new RAM (google for OWC, CRUCIAL, etc.). The battery can be replaced at an Apple Store (of course you'll have to pay for it). The Hard Drive could be a problem too, so maybe if you had to replace it, adding an SSD instead would boost the performance. 

In the end, there's little else you can replace without having to ditch the entire motherboard, and that's probably not worth the cost outside the warranty. 

Running a Linux (more tolerant sometimes with dubious RAM/Hardware in general) is a decent alternative. Ubuntu (among others) is a decent OS for casual users.