There are of course more efficient (unintelligent) methods for making a robot follow a black strip, but I agree it would be fun to try and incorporate HTM. A couple ideas come to mind.
1) You could train the robot, using an unintelligent method, having HTM remember the sequences of movements with maybe a time encoder. Then take away the black strip and have the robot drive the pattern by memory. This could probably be done by adding some external logic around existing functions of NuPIC.
2) You could use sensory-motor integration to train a simple sequence memory for "when I see this, do this". Sensory-motor integration is still in research, so depending on the approach, NuPIC might not have all the functions that would be needed to do this.
3) You could use sensory-motor integration plus reinforcement learning to train the robot to stay on the black strip. This could for example be done with reward/punishment buttons that you press any time the robot does/ doesn't do what you want, until it learns to stay on the black strip. Again, NuPIC doesn't currently have all the functions that would be needed for this. There are a few folks on the forum exploring reinforcement learning in HTM. At a high level, my approach is to use a modified spatial pooler to score action columns with the most predicted reward. I'm still working out the details on this concept though, so it may not actually be the best approach.