(a) The court, upon finding as a matter of law that a contract or contract clause was unconscionable at the time the contract was made, may refuse to enforce the contract, enforce the remainder of the contract without the unconscionable clause, or limit the application of any unconscionable clause in order to avoid an unconscionable result. For purposes of this section, a contract includes a declaration, master declaration, the articles of incorporation and bylaws of an association or master association, and a proprietary lease.
(b) Whenever it is claimed, or appears to the court, that a contract or any contract clause is or may be unconscionable, the parties, in order to aid the court in making the determination, shall be afforded a reasonable opportunity to present evidence as to:
(1) the commercial setting of the negotiations;
(2) whether a party has knowingly taken advantage of the inability of the other party reasonably to protect the other party's interests by reason of physical or mental infirmity, illiteracy, inability to understand the language of the agreement, or similar factors;
(3) the effect and purpose of the contract or clause; and
(4) if a sale, any gross disparity, at the time of contracting, between the amount charged for the property and the value of that property measured by the price at which similar property was readily obtainable in similar transaction, provided, that this factor shall not, of itself, render the contract unconscionable.