@princesn, you asked "Has anyone done an itinerary similar to this", and the answer is yes. If you search the forum you should find some other threads. Last week this was posted about Northern Spain.
Besides dave's two questions, a third, When?
Are you going in and out of Madrid? Or are you going out of somewhere else. If you are leaving from Paris, for example, Mikel's route is very good. And I share his opinion about visiting Biarritz. I favor Saint Jean de Luz, and Bayonne is very nice.
If you are going in and out of Madrid, I would go La Rioja, San Sebastian, the French Coast, back to Bilbao and then to Madrid.
If you have a car, I would add a drive through the Baztan valley.