I can't see independent Portugal being possible. Spain not allow that. And was there even suitable monarch candidates anymore? There was some revolts against Spain on 17th century but these were total failures. And later ones weren't any more succesful.
Altough in other hand there is still strong Portuguese independence movement but even currently Spain is not allowing independence. You remember these riots in Lisbon some years ago?
The unification of the Spain wasn't written on the wall, so avoid the formation of the united Spain and that would be the easiest POD for the survival of the Portuguese state.
Another possible change would be to take the Scottish step and diplomatically align the Portuguese Kingdom with those continental rivals of the Spanish Crown, such as France.