Apparatus for treating neurological disorders by means of chronic adaptive brain stimulation as a function of local biopotentials