Well, lattice structure takes place at the atomic-molecular level in how the crystals grow and cleavage is only really important to cutting methods or rock identification. (Which dwarves do automatically in any event)
They don't *affect* the quality of the gemstone, they *effect*--if there is distortion, it ceases to be that stone and becomes another related stone. All crystals are "fully formed" because it is the arrangement of atoms in a lattice that causes them to be a specific crystal in the first place.
The value of gemstones would be essentially:
Purity (chemically, i.e. color) * Clarity (Inclusions, etc.) * Size
Where purity and clarity are randomly determined values which are compared to "average" values, modified by whether "high" or "low" purity is considered optimum. So:
Color Variation/Purity Coefficient = P(actual) / P(average) if higher purity is good and P(average) / P(actual) if lower purity is good. Effectively the idea is to model whether a variety of colors is considered good or not. The process would be the same for Inclusions, unless Toady wants to get fancy and consider what the inclusions are actually comprised of. So we take C*P = Value Modifier, then use some form of the Rarity value from the raws and adjust for size.
Size would probably need to be in karats and adjust non-linearly up and down below or above a certain size threshold based on the average size of said gemstones in their cut forms. In other words, a .03ct diamond isn't really worth much, but a 300ct diamond is probably going to be worth more than 300x 1ct diamonds. So:
Size Coefficient = Size * [Size(Actual) / Size(Average)]*
Total Base Price = V * R * S
*there would probably need to be something normalizing it, but I am no math guru.
Then we can modify that value by the gem cutter's skill...
Naturally, this would probably take forever to input base values for, but given the sophistication of DF's geology models--who knows?