I'm confused. Why were you told in Amsterdam two weeks later about a refund? When your original flight from Madrid to Barcelona was canceled, were you eventually put on a later flight out of Madrid? If yes, then the airline does not have to refund your ticket but they may owe you money to cover any extra housing/food expenses?
The EU mandated that all passengers on flights that were canceled or delayed due to volcanic activity must be compensated for additional housing/food expenses.
If there was no substituted flight you are definitely owed a refund. I've seen this before. It's not Iberia refusing to pay...it's the travel agent playing games.
I once had a family on one of my tours from Australia. The tour they had booked was canceled and the travel agent was notified weeks in advance. Only the travel agent didn't want to lose his commission so he didn't tell the passengers. They flew half way around the world to be told no tour. Luckily we had a similar tour leaving a day later they could join.
Sadly, there are some travel agents who aren't completely honest.
Now, regarding rule 261/2004. It does come into practice here but with some modifications made due to the volcano. Here's the press release from the EU:
Volcanic Ash and EU Passenger Rights