If you don't already have lodgings booked in Pamplona it may be too late to find something. I don't know how far afield you might need to go to find beds. Maybe Logrono or Olite?
It can be really hot in Zaragoza in the summer. I'm not sure about Pamplona; it may not be as bad. Be sure you have air conditioned accommodations in those two cities and in Barcelona. You might get by without a/c in the Basque Country, where there might be the odd temperature spike but it's unlikely to stay hot for long.
Four nights is a rather long time in San Sebastian unless that is to be a beach break (in which case be aware that the Basque Country is not always sunny even in mid-summer). Possible side-trips include Hondarribia to the east and three coastal towns to the west, Zarautz, Getaria and Zumaia. I also liked Vitoria-Gasteiz, the capital of the inland part of the Basque Country and not terribly far from Laguardia. It has a large historic district on a hill that is called the "medieval almond" because of its shape on the map. However, you may get enough medieval architecture in Bilbao, San Sebastian and Laguardia.
Consult ViaMichelin on driving routes. Green highlighting means "scenic". It's possible to do a good bit of the drive from the Basque Country (Sp. or Fr.) to Barcelona through France. You'd give up Zaragoza but have a shot at the Pyrenees. I haven't roadtripped through that area but can recommend the narrow-gauge Yellow Train (run by SNCF) that runs from Villefranche-de-Conflent to Latour de Carol.