When should I add diced vegetables to a pie, and how long to cook them for?
There are two approaches you could use on this, which are to either make a stew with all the ingredients and then turn it into a pie, or prepare separately and then put together into a pie. Which to choose depends on your personal preference. Using the stew method blends all the flavors together and is less work and cleanup as you don't have to cook the vegetables separately. Cooking separately keeps the flavors of each vegetable more distinct, but is more work and cleanup. Personally I prefer the stew method as I like the blending of flavors. 

Either way the challenge as you have recognized is to get the vegetables to the right cooked consistency, and in either case the answer is to subtract the cooking time imparted by the baking from the pre-cooking time. Baking does not cook the vegetables nearly as quickly, over time I have figured that using a 3 to 4x multiplier works ok, if a vegetable takes 5 minutes in the steamer to cook it will take between 15-20 minutes in the oven roughly. So for carrots you would ordinarily cook for 15 minutes you would pre-cook them for 10 minutes and then bake for 15-20 minutes. 

Another option is to use a fork to test doneness, I've found that if I can get a fork to just start to sink into a carrot piece then putting it into the oven for 15 minutes will finish it off. Getting the vegetables to this state at the same time is the challenge, but it can be done. 

This is my personal experience with cooking vegetables to be done at the same time, from longest to shortest cooking times:


Beans
Hard root vegetables: carrots are in this class
Other roots: potatoes, parsnips, turnips
Squashes
Hard leafy vegetables: winter greens, collards, cabbages
Brassicas (broccoli, cauliflower), string beans
Soft leafy vegetables: spinach, kale
Green peas: these take no time at all, cooking them more than a couple of minutes turns them to mush


There's a lot of variation between these classes, for instance cauliflower takes longer than broccoli, and thick runner beans take twice as long as fine french beans. You need to keep these in mind. 

If you are making a pastry topped pie the only thing baking is for is to cook the pastry top. If you cool the filling below a certain point the vegetables will stop cooking, or at least slow down quite a bit. My favorite trick is to wait until the vegetables are just about perfect before dumping a couple of handfuls of frozen peas into my filling, this melts the peas and they cook perfectly in the residual heat while bringing the temperature down quickly. I then fill and bake.