I have some doubts that the challenge is even possible to accomplish in these exact terms. After the traumatic experience of the OTL Iberian Union, the Portuguese wouldn't be tricked into trying something like that again, and I doubt that the finances of a an actual Spanish conquest of Portugal would work.
What I mean by this is simple: Spain definitely has enough troops to overrun mainland Portugal if they really committ, but it wouldn't be a walk in the park and the resistance war that would surely ensue would put a significant strain on the Spanish Crown. Given that it's impossible that Spain could also take Portugal's colonies in that same invasion (maybe some parts of southern Brazil at most, but even that is fairly unlikely and you can forget about the rest), all that they would gain would be an overpopulated, not particularly productive and extremely rebelious western province. Why would they want that?
What I mean by this is simple: Spain definitely has enough troops to overrun mainland Portugal if they really committ, but it wouldn't be a walk in the park and the resistance war that would surely ensue would put a significant strain on the Spanish Crown. Given that it's impossible that Spain could also take Portugal's colonies in that same invasion (maybe some parts of southern Brazil at most, but even that is fairly unlikely and you can forget about the rest), all that they would gain would be an overpopulated, not particularly productive and extremely rebelious western province. Why would they want that?