Cook beans: Cover beans with cold water by 2 inches in a bowl and soak at room temperature at least 8 hours or quick-soak. Drain well in a colander.
Blanch onions in boiling salted water , 1 minute, then drain and peel.
Cover beans with cold water by about 1 inch in a 5- to 6-quart pot and bring to a boil. Add onions and simmer, partially covered, skimming froth as necessary, until beans and onions are tender, 40 minutes to 1 hour. Stir in salt and let stand (in cooking liquid), uncovered.
Roast tomatoes while beans are cooking: Put oven rack in upper third of oven and preheat oven to 500°F
Toss tomato halves and cherry tomatoes with salt, sugar, and oil in a shallow 3-quart baking dish, then arrange tomato halves cut sides up.
Roast tomatoes, uncovered, until large tomatoes are very tender with brown patches and cherry tomatoes are falling apart, 35 to 50 minutes.
Assemble dish: Transfer warm beans and onions with a slotted spoon to a deep large platter. Arrange tomatoes decoratively on top of beans and pour tomato juices on top. Sprinkle with basil leaves.