Hmmm, seams to be a bug where the eCart object editor is removing single quotes at the end.
try adding the calculation in the eCart object as:
(abs([Quantity] > [AvailableQuantity])?[Quantity] = [AvailableQuantity]:")
with surrounding parenthesis, I just tested this, and it worked on my system.
I will log this in our bugbase.
NOTE: in your code in message #9, there is 1 double quote character at the end, not 2 single quotes