Heat the olive oil in a wide, heavy pot or deep skillet over medium heat. Add the onion and a pinch of salt and cook until soft and lightly golden, 6–8 minutes. Add the garlic and pepper flakes and cook 1 minute.
Stir in the tomato paste and cook for a minute until it darkens slightly.
Add the green beans, diced tomatoes with juices, water, salt and sugar. Stir to coat the beans and bring to a simmer.
Cover, reduce the heat to low and simmer gently for 30–40 minutes, stirring every 10 minutes, until the beans are very tender and the sauce has thickened. If it looks dry, add a few tablespoons of water.
Uncover for the last 5 minutes if the sauce is thin. Stir in the lemon juice and most of the herbs, then taste for salt.
Transfer to a serving dish and top with the feta and remaining herbs. Serve warm or at room temperature.