Not to belabor the point, but one final thing I wanted to say: What you described here is sort of the run-of-the-mill, day-in-the-life of a family law attorney type of case. I've had (and have) many cases just as messed up as yours--I get calls like yours with crazy facts like this all the time- and this just serves to illustrate to everyone how complicated family law can get and how important it is to seek out good advice on the subject. I'm an attorney and a certified family law specialist myself and this stuff is hard for us much of the time. Sometimes we have to scratch ours heads and say,"What in the world is going on..?" So, at least consult with a lawyer who limits his or her practice to family law or who is a certifed specialist in the field if your state certifes specialties in law.
Here's just one small example of why your question is a tuff one in some respects: if the mom received TANF during the time the kids were with you and the county seeks reimbursement for that same time at the CS guideline, can you defend and not have to pay by proving the kids were with you during that time? We don't have an answer to that in California (some other state might but I doubt it) but we do have case law that says you can in non-welfare cases (e.g, mom just has a support order and is not on welfare and it runs while the kids are with you--).. But does the same rule apply if it's welfare reimbursement? Should it? Why? That's the kind of stuff that requires a sophisticated argument and good P's and A's for a judge.
This stuff to way over the heads of anyone at a law clinic staffed by law students -BELIEVE ME- or at some university with a law school- most of the professers wouldn't be able to fully answer these questions either. So at least find a family law attorney who knows her/her stuff. It will be worth the consult fee.
All the best