The wriggling/writhing would indicate its probably not just a habit, but there's some level of discomfort involved, IMO.
TBH, I'd go with shush/pat to sleep train at this point. PUPD is a last resort method to be used when shush/pat has been used consistently for at least 1-2 weeks with no improvement. Basically, she should be going as long at night between feeds as she does in the day, so if she's having a feed every 4hr in the day, you would wait until at least 4hr has passed before feeding at night. Decide before you go in to her whether you will feed or resettle and stick with it. If you're going to feed, do it straight away. If you're going to resettle, you have to get her back to sleep without feeding - if you cave in, you're effectively teaching her that if she cries long enough, she'll get fed.
If she has a sensitive tummy, ibuprofen may not be the best for her - have you noticed any link between med doses and tummy discomfort?