parenthesis placement is not specific to thee calculations, really. parenthesis placement strategy is pretty standard throughout all php coding.

parenthesis are used for two purposes:
1) Pass arguments to a function;
runThis(argument1, argumet2, argumet3)

2) Group expressions to create conditional logic;
(expression1 || expression2) && (expression3 || expression4)

the above example will evaluate to true if exression1 or 2 is true AND expresion3 or 4 are true.

the calculation are using the php abs() function to create a ternary expression.

ternary expression is a shortened if statement, it consists of a question, a true part and a false part. instead of:
if(expression1 == "foo") {
return "foo";
}else {
return "bar";
}

we can write:
return (expresion1 == "foo")?"foo":"bar";

the true price calumniation is a collection of ternary conditions, for each one the false response is 0. they are all added together using the addition operator. the first 2 parts look like this:
1- ((abs(([Size] == '50ml') && [Quantity] < 12))?[Price]:0)
2- ((abs(([Size] == '50ml') && [Quantity] == 12))?[price50mlCase]:0)

if the first one evalutes to tru it will return the price, other wise it returns 0, the second one returns the 50ML case price or 0.

in the calculation, they are added together:
((abs(([Size] == '50ml') && [Quantity] < 12))?[Price]:0) + ((abs(([Size] == '50ml') && [Quantity] == 12))?[price50mlCase]:0)

so it ends up as being:
Price + 0
or
0 + 50MLCasePrice

yes, with the number of conditions you have, the calculation may get very long

This may be a good argument for creating a database table that contains the price for each condition, and creating a recordset that will lookup the price to use based on the selections made. this is why it is important to have all of the information on how pricing is going to work before you start development. that information is important in determining how to develop the cart.