Ok, that is pretty cool. Next up, inducing neural activity in worms to drive them around. If you can go both ways (observe and predict, and induce and demonstrate) you really do have the worm's brain all figured out.
Then you build a mining robot with mineral sensors that can detect the ore your interested in. Now you strap in your worm brain and you have your local computer translate motion signals into robot motion, and mineral detection into food detection. And voila you have a robotic miner which forages around for ore to process.