Under declaring the price of properties on a purchase-sale contract is customary in this country. This, however, does not mean it is legal. In fact, it is quite the contrary. Laws in Granada are exactly the same as in La Coruņa or Tenerife. It is understandable that the lawyer of the other party says there will be no problem. He is representing the interests of the seller.
The agreement you suggest is useful for the purpose of covering yourself against the risk of the taxman raising a supplementary demand for tax. However, I do also recommend you have a separate agreement stating what the real price is in case something goes wrong.
I strongly recommend you hire a lawyer to ensure a smooth transfer of title.
Regards