The Royal Palace is very cool, as are the other big art museums: Thyssen-Borenmisza and Reina Sofía. I would catch the Santiago Bernabeu stadium and do a tour there. El Escorial isn’t in Madrid proper, but almost everyone visits from there, and it’s definitely a can’t-miss in the Madrid area.
The Buen Retiro park and the big fountains (like Cibeles where Real Madrid fans gather to celebrate) and the Plaza Mayor and the Gran Via are very cool — I love grabbing lunch or dinner at one of the restaurants in the Plaza Mayor. The Convento de las Descalzas is pretty awesome, and the National Museum of Anthropology is pretty cool if you like archaeology. There are several old mansions you can visit; I like the Cerralbo. You already mentioned the Mercado San Miguel, which I also try to hit whenever I visit.
There are two amazing easy daytrips from Madrid that I consider to be can’t-miss: Toledo and Segovia. You can catch the highlights of both in one day each, although I prefer to stay overnight (esp. in Toledo). Avila and Salamanca are also doable day tips, although a bit further away, and Salamanca is definitely better if you stay one or two nights. Valle de Los Caídos up in the mountains is interesting and worth visiting, kind of near El Escorial, although it is somewhat controversial politically.