It's over ten hours by train from Santiago de Compostela, so I wouldn't want to make those two cities my only overnight stops, with a bunch of day-trips--much as I hate changing hotels. Depending on how you want to use your time (and that big 7-day vs. 10-day question), you might consider stopping for a day-time look at Ourense, spending 2 or 3 nights in Leon (side-trip to Astorga is easy if you want to see the modernista site), then spending at least one night in Burgos. Burgos is not undiscovered; it's on the pilgrimage route. But the cathedral is lovely, there's a pleasant river flowing through town, and there are two nice monasteries to explore on the outskirts of town (public transportation very iffy on Sundays if not on Saturdays). Also be aware that a world-class wind is likely to be blowing in Burgos at any given time.
I suggest taking a look at the direct train route between SdeC and Bilbao (Deutsche Bahn is easier to use for this purpose, though it won't give you fares). Click on "Show details" then on "Show intermediate stops". Recognize that any divergence from that route (such as trying to hit coastal cities) is going to add a lot of travel time and mean more buses. The buses are perfectly comfortable, but I just don't think you can afford the time.
So now you've gotten to Bilbao. Side-trips to San Sebastian and Vitoria-Gasteiz are possible, both by bus. The train between Bilbao and San Sebastian takes a very picturesque route but is much, much slower than the bus, and I don't think you can spare the time.
Although you can certainly go to Santander, I want to discourage that. Due to a massive fire in the 1940s, it's a mostly modern city of (in my opinion) not much architectural interest. Yes, it has a magnificent beach, but so does San Sebastian. If you've seen one big stretch of sand, do you need to see another? There are reasons to go to Santander, but to me they involve side-trips to places like Comillas (modernista architecture), Santillana del Mar (highly picturesque, totally touristy medieval village), and the Altamira replica cave--any of which would be rather challenging if you were sleeping in Bilbao, because you'd have the considerable added travel time of the Bilbao-Santander roundtrip to deal with.
More workable options from Bilbao include Bermeo, a former fishing village accessible by local train (or also by bus), and Lekeitio, another coastal town mentioned in several guidebooks, but which I haven't seen. Lekeitio means a bus ride (not via Bermeo).
Bilbao itself is worth the better part of two days if you're interested in the art museums. The historic district is relatively large, and the downtown area has a lot of attractive later architecture from around the turn of the 20th century.
Much of the Basque countryside is very pretty, so don't resist making trips through the interior.
The more I re-read your original post, the more I think you have 10 days, total, including Madrid. Honestly, I think trying to hit Madrid, Galicia and the Basque Country, plus a necessary point or two in between, is an awful lot for that period of time, especially if you have an interest in art (museums in Cuenca, Bilbao, San Sebastian, Vitoria; probably also in Salamanca and Santiago de Compostela). Are you sure you want to use part of your time in Italy rather than spending it all in Spain?
On the other hand, I should point out that your Basque Country destinations and much of Galicia are great places to visit in mid-summer when the rest of Spain can be miserably hot. You're traveling in late September, so this isn't a trip on which you need to focus on northern Spain and try to see absolutely everything of interest in that part of the country.