What does "The brain has its own language for testing the structure and consistency of the world." refer to?
Dr. Sagan is referring to the brain's ability to produce models of the world in order to test predictions. 

In terms of psychology contemporary with Carl Sagan, he may have been referring to, in part, the theory of schemas. This is a general representation of a thing or idea that is used in classifying or identifying the thing or idea. In developmental psychology, the idea of Jean Piaget's schema might appear as a young child identifying all four-legged animals as "doggies." As the child grows, they will begin to differentiate, and for example, know horse vs. dog (but might classify a zebra as a horse). 

The "language" of the brain seems to be an emergent property of neuronal firing. When a neuron elicits an action potential, it produces a voltage pulse that (usually) travels down the axon. Neurons can stimulate each other when synapses are triggered by an action potential of the pre-synaptic neuron. This is a simplified explanation: there are also graded synapses that aren't action potential-triggered.

Dr. Sagan might also have been thinking of the 1981 Nobel Prize-winning research by Hubel, Wiesel, and Sperry, whose mid-twentieth century research demonstrates how receptive fields for retinal neurons map onto the visual cortex. Retinotopic maps show how the brain putatively represents visual stimuli in the cortex.

In the early 1990s, researchers began investigating the "neural code" in earnest. A rate code is the idea that information is carried in the particular firing rate of a neuron, that is, the mean number of action potentials per second. A temporal code is when information is contained in the timing of spikes, not just the mean firing rate. Charles Frye has a great explanation with citations.

Symbolic processing in the brain is an active field of research. The problem can be approached from top-down neuropsychological assays, or from down-up electrophysiology. There is little doubt that symbolic processing is performed by neurons working in concert, though the exact mechanisms for all but the crudest processes are unknown. 

Here are some examples: Theoretical models [1, 2] have shown how layers of neurons with different properties can be used to filter or transform data. In addition, high-level models have demonstrated possible methods by which cognitive units comprised of one or more neurons can determine the solution to symbolic problems [3]. In addition, electrophysiological assays show how cells in the cortex of mammals "record" and represent physical data for use in navigation [4].



[1] Gjorgjieva, Julijana &amp; Drion, Guillaume &amp; Marder, Eve. (2016). Computational Implications of Biophysical Diversity and Multiple Timescales in Neurons and Synapses for Circuit Performance. Current Opinion in Neurobiology. 37. 44-52. 10.1016/j.conb.2015.12.008. 

[2] Shankar, K. H., and Howard, M. W. (2012). A scale-invariant internal representation of time, Neural Computation, 24, 134–193.

[3] Hasselmo ME, Stern CE (2018) A network model of behavioural performance in a rule learning task. Phil. Trans. R. Soc. B 373 : 20170275. PMCID: PMC5832697. PDF

[4] Hinman JR, Dannenberg H, Alexander A, Hasselmo ME. (2018) Neural mechanisms of navigation involving interactions of cortical and subcortical structures. J. Neurophysiol. 119(6):2007-2029. PDF