I haven't been to Porto, but I have no doubt you'd be happy spending the extra days in Barcelona. There is more worthwhile sightseeing to do in Barcelona than you could easily fit into festival days, and if you managed to see everything, there are several reasonably accessible beaches (and the weather should be warm enough for swimming or sunbathing by Primavera).
Another option would be going to Madrid in between. A high speed train would get you between Barcelona and Madrid in a couple of hours; Madrid has more than enough world class museums, fabulous restrooms and nightlife to help you kill a few days. You'd have several options of train, bus and air travel between Madrid and Porto.