Devices, systems and methods for treating medical disorders, such as migraine or other primary headaches, or fibromyalgia, by noninvasive electrical stimulation of a vagus nerve, used in conjunction with the measurement of evoked potentials (EPs). The system comprises a stimulator that is applied to the surface of the patient's neck to apply electrical impulses sufficient to stimulate a cervical vagus nerve, scalp electrodes that are used to measure EPs that are evoked by that stimulation, feedback or biofeedback circuits to vary the stimulation based upon EP characteristics, and other sensory stimulation modalities that produce EPs. The system is preferably used to optimize the placement of the stimulator, to test whether a patient is a suitable candidate for treatment using vagus nerve stimulation, and to select the stimulation parameters that optimized acute or chronic treatment, e.g., by correcting an EP habituation deficit.