In a medium-sized nonreactive saucepan, combine the shallots, port, stock, sugar, vinegar and butter. Set over medium heat and bring to a brisk simmer. Cook uncovered, stirring once or twice, until the shallots are almost tender, about 20 minutes. Add the thyme and a generous grinding of pepper and cook, stirring once or twice, until the liquid is reduced to a saucy glaze that lightly coats the shallots, another 5 to 7 minutes. Add a pinch of salt, to taste. Serve hot