In a large (12-inch) skillet with a lid, heat the olive oil over medium heat. Add the onion and cook, stirring occasionally, until soft and lightly golden, 4 to 5 minutes. Add the green beans, salt, and black pepper, and stir well. Reduce the heat to medium low and cook, stirring occasionally, until the onions are caramelized and the beans start to soften and brown lightly, about 10 minutes.
Add the tomatoes, garlic, sugar, allspice, and cinnamon. Stir well, reduce the heat to low, cover, and cook, stirring occasionally, until the beans are very tender throughout, 15 to 20 minutes, or longer if a softer texture is desired. Season to taste with salt and pepper. Serve warm or at room temperature.