Soak beans in water to cover by 2 inches overnight (8 hours) or quick-soak (see cooks’ note, below), then drain.
Cover beans with water by 2 inches in a 5- to 6-qt pot. Bring to a boil, then reduce heat and briskly simmer, uncovered, stirring occasionally and skimming foam, until beans are very tender, 40 to 50 minutes. Reserve 2 cups cooking water, then drain beans. Cut half of tomatoes lengthwise and set aside. Pulse remaining tomatoes in a food processor until almost smooth.
Preheat oven to 450°F with rack in middle.
Cook onion and garlic in oil and 1 Tbsp butter with 1/4 tsp each of salt and pepper in a 12-inch heavy skillet, stirring occasionally, until softened, about 5 minutes. Add tomato purée, thyme, sugar, 3/4 tsp salt, and reserved 2 cups bean-cooking water and simmer, stirring occasionally, until liquid is slightly thickened, about 10 minutes. Whisk in remaining Tbsp butter, then stir in beans.
Transfer to a 3-qt shallow baking dish. Sprinkle evenly with cheese, then scatter tomato halves over top. Bake, covered tightly with foil, until liquid is reduced and beans are saucy but not soupy, 25 to 30 minutes. Let stand, covered, 10 minutes before serving (beans will continue to absorb liquid).