The short answer (of course, this is my opinion): Yes, book the tickets now.
The long, meandering answer (still my opinion):
I've taken the train a few times from Santiago de Compostela to Chamartin station in Madrid. It's a lovely, serene journey and if it's decent weather, fairly scenic for the first couple of hours. The nice thing about taking the train is that you arrive in downtown Madrid. Of course, it's nice provided you have a bit of time to enjoy the city.
If you are planning to find accommodations close to the Madrid airport, then flying is a great idea. SCQ is, as you can imagine, easy to get to and easy to get around. Transportation out of MAD (by train, bus, taxi or hotel shuttle) is also very easy. If it were me, and I had found a reasonable airfare, I would book the flights now.
Buen Camino!