Haven't heard it as a sign of ulcers but my WB does it when she has a sore/gassy/colicky stomach as a sign of pain, always makes my heart sink when I see her do it
I think any unusual mouth behaviour can be attributed to stomach pain. Mine did an odd chewing/ mouthing thing over the stable door prior to ulcers being found.