Dragonblade
Adventurer
If the party is 20th level and the dragon is 30th level, then just have the Star Blood grant a +10 bonus to attacks and all defenses and for the duration of the encounter. It also grants 50 temp HPs that last the entire encounter. Done. Its simple and easy to remember and generally works mathematically.
Next I recommend finding the stat block of a solo ancient dragon that is close to level 30 as possible and using that as a baseline with some tweaks. Shift the level to 30 by adding +1 to attacks and defenses for every level it needs to boost it to 30. If the stat block comes from a pre-MM3 source, then add +15 damage to any attack or aura the creature has and subtract 2 from all its defenses (after you have level shifted it to 30). If your players are highly optimized, add 20 to all its damage instead of +15.
Add about 10 HP per level you need to increase it to reach level 30, otherwise leave HP alone. Have the dragon make saves at the beginning of the dragon's turn, instead of at the end, AND if it fails a save, or has a condition that can't be saved against, it can choose to automatically shake off any condition or ongoing effect that afflicts it, regardless of current duration, but in exchange it takes 15 damage per each condition or ongoing effect it ends in this way.
That will solve the issue of player's stun locking it. Your dragon gets to still take its actions, but the PCs conditions aren't simply ignored or handwaved away. That's how I would do it.
Next I recommend finding the stat block of a solo ancient dragon that is close to level 30 as possible and using that as a baseline with some tweaks. Shift the level to 30 by adding +1 to attacks and defenses for every level it needs to boost it to 30. If the stat block comes from a pre-MM3 source, then add +15 damage to any attack or aura the creature has and subtract 2 from all its defenses (after you have level shifted it to 30). If your players are highly optimized, add 20 to all its damage instead of +15.
Add about 10 HP per level you need to increase it to reach level 30, otherwise leave HP alone. Have the dragon make saves at the beginning of the dragon's turn, instead of at the end, AND if it fails a save, or has a condition that can't be saved against, it can choose to automatically shake off any condition or ongoing effect that afflicts it, regardless of current duration, but in exchange it takes 15 damage per each condition or ongoing effect it ends in this way.
That will solve the issue of player's stun locking it. Your dragon gets to still take its actions, but the PCs conditions aren't simply ignored or handwaved away. That's how I would do it.