Heat the butter in a pan. Sauté the onions, scatter over the sugar, continue to sauté, stirring continuously, until the sugar has dissolved. Add the wine, balsamic, salt and thyme, bring to the boil. Cover and simmer over a low heat for approx. 10 mins. until soft. Remove the pan from the heat, allow to cool slightly.
Spread half of the onion confit onto 4 slices of bread. Place the cheese on top, then spread over a little more confit. Place the remaining bread slices on top, press down lightly. Brush both sides of the sandwiches with butter. Heat a non-stick frying pan. Fry the sandwiches for approx. 5 mins. on each side until golden brown.