hmm I like turtles as well but I'm not sure how practical it would be to wander around the infrastructure of the house where I will often go to add stuff. Though a persistent movement code will prevent them from causing problems if I encounter them, I tend to forget such things as their travel paths and might place something in their way when they are not there.
The concept is that you use one turtle, two ender chests, and a power storage device as a "remote power unit". The turtle does not need to move, unless you decide for some reason that you want the turtle to move, which would ruin efficiency.
Code:
MFSU
Turtle> Ender Chest #2
Ender Chest #1
The ">" denotes the direction the turtle is facing. This specific setup is for using full batteries. The turtle grabs a battery from one of the chests (I usually use the #2 spot, as the enemy gate is down, and as such that is where my dead batteries go as well), and plops it into the MFSU (or MFE, or BatBox, or whatnot). It then sucks it out every so often (five to ten seconds) to compare it against an empty battery in its inventory. When they match, it outputs the battery downward, and grabs a new battery.
In your code, you want to have the turtle first check if it can suck a battery from the MFSU, and then check to see if it has a battery in hand. This means that, one reload from being unloaded in a chunk, it won't grab another battery when it already has one.