Keep in mind that most sit down type proper restaurants will not even be open by then, and I would bet you do not want to be up at 10:00 PM eating, so you are probably looking at Tapas, which in my opinion is better anyway.
The previous poster mentioned a Mercado, on the other side of Plaza Major is Mercado San Miguel, think Spanish Food Court. Different stalls selling a variety of eats and drinks, take them to a table in the center and enjoy. It is wonderful, worth a stop, but it will be crowded, you may not be able to find a place to stand or sit, and a meal would require stops at several stands, something you may not want to do when tired.
For a more traditional Tapas bar, maybe head to Calle De la Cruz, there are several places; Casa Toni, La Casa del Abuelo, others; where you can look at a menu, get Raciones (appetizer sized plates) and something to drink. For more of a meal, it may be further (a walk will do you good), but I like Los Gatos on Calle Jesus, there are many other places on this street as well.