Full line of succession in Portugal after the death of Prince Alfonso of Portugal
The King John II
(his sister the late princess Juana)
Manuel, Duke of Beja (still unmarried, and his eventual heirs)
Queen Eleanor of Portugal (wife of King John)
Isabella of Viseu, Duchess of Braganza (and her heirs, she had two living son)
Emperor Maximilian (and his heirs)
Juana la Beltranjea
in theory the heirs of Queen Isabella of Portugal (but they would be higher if King John II was not the only one still alive)
Philip of Cleves (unmarried)
Dowager Queen Isabella of Castile
her daughter Queen Isabella of Castile (and her heirs)
Beatrice, Duchess of Viseu (mother of Manuel, Eleanor and Isabella)
in theory the heirs of Charles the Bold (who are higher as his only late daughter Mary was wife of Emperor Maximilian)
The only thing who you can do for preventing Manuel’s succession after Alfonso’s death is having Jorge of Lencastre (aka the illegitimate son of John II) legitimized and so made heir instead of Manuel... Or you can have a Juana of Portugal (aka King John II’s sister) who had married and left heirs or Manuel’s oldest brother John surving or his other older brother Diego not killed by John II....
Kill of Manuel and the next in linen will be Queen Eleanor, then her sister Isabella of Viseu and her two sons...