We consider a mobile ad hoc sensor network. The mobility of the sensor nodes is designed with the cost of communication and mobility in mind along with consideration of the possible scanning tasks of the nodes. Our mobility algorithm is developed in the context of a distributed system where, for any single mobile node, only local information about associated energy costs is known. We use a distributed simulated annealing framework to govern the motion of the nodes and prove that, in a limiting sense, a global objective function comprising mobility and communication energy costs are minimized. This paper concludes with a simulation study focusing on mobile sensors with dual roles of scanning and relaying higher priority tracking traffic from tracking nodes.