I really think it should be tied to the crafter's skill roll, not price of materials. After all - real masterworks are not a function of only getting the most expensive materials - it's about the skill and care and inspiration of the crafter.
Maybe do it like a critical hit - if the roll to create is a natural 20, roll agian and add the same modifiers, if you succeed on the second roll then the object is masterwork, and gains all the benefits of that. You cannot take 20 to get a masterwork item.
- Ma'at