Sauté the onion in some olive oil for about 10 minutes until softened. Stir in the balsamic vinegar and cook for 1 minute or so. Remove and cool.
At the same time, sauté the mushrooms in olive oil with the thyme for about 10 minutes until softened. Season and cool.
Roll out the puff pastry to a 30cm square. Cut in half to give two rectangles and place one on a non stick baking sheet. Brush the edges with the egg glaze. Slash the centre of the other with a sharp knife, leaving a 2cm border.
Mix the onions, mushrooms, stilton and marscarpone. Pile down the centre of the unslashed half of the puff pastry, then fit over the slashed half and press the edges well together. Press all the way round with a fork to seal.
Brush the pastry evenly with the egg glaze and bake for 25 minutes until golden brown and crisp.