Are you referring to the seller here?
Was the car sold as having 40k miles? Do you still have a copy of the advert? Bit late now, but I'm guessing you didn't do an HPI check?
Look at the MOT history online, you should see the difference in recorded mileage.
Sounds like you'll probably end up going down small claims if you want a refund from the seller however the remap does add another dimension which may not make it clear, especially in the eyes of a judge who won't be a car person. What you need is some sort of expert diagnosis, which is the route you seem to be going down by asking BMW, this is the correct path to choose - be sure to get a detailed report from them, outlining the suspected cause if possible. when the BMW quote is really high I'd check it with a local BMW specialist as getting it fixed and moving on might be the least hassle, given the remap situation, that does seem like a potential get out clause from the seller. If you can prove they lied about the mileage I still think you're good to ask for a refund (especially if it's after fixing the current issue yourself).