The Shulchan Aruch (253) discusses a case of one who transgressed the halacha and left something on an open flame going into Shabbat. After the fact, is one allowed to eat the food or not? The halacha in such a case depends on numerous factors such as the type of food, the degree to which it was cooked and the intention of the cook.
The practical application of this halacha would be, for example, a case where one is a guest in someone else’s home for the Shabbat meal. The host of course keeps kosher and knows that it is forbidden to cook on Shabbat, but they are not familiar with the halachic details concerning blechs and leaving food on the flame. If one comes into their house on Friday night and sees to his dismay that all the food is on an open flame without a blech, the question is: Is it permissible to eat this food? Does one have to begin investigating the various factors discussed in the Shulchan Aruch regarding the type of food, the degree it was cooked and the intention of the cook?
Hacham Ben Sion in the second volume of Or LeSion (Three-volume collection of responsa by Hacham Ben Sion Abba Shaul, one of the leading Sephardic Rabbis in 20th-century Israel) offers a chidush in this case. He says that it is true that one must be strict with regard to our stovetops and use a blech. However, b’diavad, after the fact, if the food was already left on the open flame, one may be lenient and eat the food.
This ruling is based on the reasoning that our modern day stovetops are less problematic than old-fashioned ovens. In ancient, wood burning ovens there was a clear concern that one might come to stoke the dwindling coals. In our stovetops, the flame is fed by a constant and steady flow of gas that is either on or off. There is no dwindling of the fire which might evoke stoking. Therefore, although the proper practice is to use a blech, if someone inadvertently did not do so, the food is still permissible to be eaten. However, if a person intentionally violated the halacha, knowing that placing food on the open flame was forbidden, Hacham Ben Sion would not be so lenient.
Summary: If one unintentionally left food on the open flame of a modern stovetop from before Shabbat, the food is permissible to eat on Shabbat.