No matter what level you choose to evolve your Pokemon, EVs for a certain stat will always stay the same. The stat itself, however, is subject to change due to the different evolution stages having different base stats.
If your Doublade has maxed EVs in a certain stat, then the EVs will stay maxed, but it will change according to Aegislash's base stats.
Here's a situation:
Doublade #1:
- This Doublade has 252 EVs in special attack (assuming 31 IVs and neutral nature) at level 36, which gives a special attack stat of 71.
- When you level it up to level 40 as a Doublade, its special attack stat will then be 78.
- Upon evolution via dusk stone, it still has 252 EVs in special attack, but since Aegislash (shield form) has a higher base special attack stat than Doublade, its new special attack stat at level 40 is 82.
If this Aegislash were leveled to level 50, it would have a special attack stat of 102.
Doublade #2:
- This Doublade has the same EVs, IVs, and Nature as the last one at level 36, giving it a special attack stat of 71.
- When you level this one up to level 50, its special attack stat will be 97 as well.
- Upon evolution via dusk stone, it still has 252 EVs in special attack, but since Aegislash (shield form) has a higher base special attack stat than Doublade, its new special attack stat at level 50 is 102.
Since this Pokemon is at level 50 already, its special attack stat at level 50 is 102.
As you can see from this, both methods produce the same results. Hope this helps :)