Bring a large pot of lightly salted water to a boil; cook green beans at a boil until tender yet firm to the bite, 5 to 10 minutes; drain and transfer to a 9x13-inch dish. Cook and stir onions, vinegar, garlic, sugar, basil, and oregano in a skillet over medium heat until onions are softened and translucent, about 5 minutes. Reduce heat to medium-low, and continue cooking and stirring until onions are very tender and dark brown, 15 to 20 minutes more. Preheat oven to 400 degrees F (200 degrees C). Spread onion mixture over green beans and top with Parmesan cheese. Arrange tomatoes, cut sides down, atop Parmesan cheese layer. Bake in the preheated oven until cheese is melted and bubbling, about 35 minutes.