In the long run, M-class stars would not really affect the ratio of elements in the universe. The big ones may create a surplus of elements as they die, but the smaller ones have a quieter death in the form of a helium white dwarf (which do not exist yet due to the vast timescales required for their inception, as you said), and do not release as many 'useful' elements. More massive stars could continue to fuse helium into carbon, carbon into oxygen, oxygen into silicon and silicon into iron. So-called 'Iron Stars' could be the end result, though these are more theoretical since of course we have no examples of these in the observable universe. In the very, very, very end of the universe, only black-holes would exist, sucking up anything that is nearby, before ripping themselves apart by their own Hawking radiation. Then the universe may enter a high entropy state of quantum vacuums. Maybe.I don't know how much it would effect the outcome but M class stars are entirely convective so they will eventually fuse practically all their Hydrogen and continue as a Helium burning convective star. But one thing is the rate they fuse at is so much slower than the core fusion stars, in order of 100s of billions of years, perhaps into the trillions. They also happen to be quite common.