I agree to skip Tangier - plan out how you will get to the port and then from the port back to where you want to be. It's harder than it seems.
Your number of nights per place is good. People will quibble with it, for example I think Cordoba is a one night and both Seville and Granada need more (Seville especially). I would skip tangier, take Cordoba to 1 night and add one night to each Seville and Granada. But as I said this is quibbling - you would have a good trip on what you have!
If you are looking at Seville, Cordoba, Granada and maybe Ronda then trains or busses will be best. I've found that ALSA busses sometimes have better schedules than the train on some non-high speed routes.
If you want to tour some of the smaller hill towns then a car could be useful - but this isn't on your list and would probably take too much time. Also it will be hard to drive and park in some of the old towns. Roads between towns and into town from the highway are good, but obviously the roads inside ancient towns aren't made for cars! You will see people driving down roads about the same width as the car and pedestrians standing in doorways to let the car pass. Best bet if you do drive is to park on the outskirts of town and walk in, unless you are staying overnight and your hotel gives you specific directions to a parking lot nearby. In general I'd say stick with the towns/cities you have listed and connect them by train and bus.