Hi Lorenzo,
When I first came upon OpenWorm a few years ago, coming from a machine learning artificial neural network viewpoint, it also occurred to me to try to learn how the worm's sensory-motor network might be trained to do some input-output tasks. As interesting as that project was, of course the worm's neurons are not perceptron-like and don't learn as an ANN does. It remains a huge challenge to discover how the worm's connectome is weighted to allow it to function. There are a number of synaptic and non-synaptic neurotransmitters to deal with. For such a relatively simple creature, it is amazingly complex!
Tom