Use this Commandcommand in a repeat. Command Block (1.13+):
/execute as @a[nbt={Inventory:[{Slot:102b,id:"minecraft:iron_chestplate"}]}] run replaceitem entity @s armor.chest minecraft:chainmail_chestplate 1
/execute as @a[nbt={Inventory:[{Slot:102b,id:"minecraft:iron_chestplate"}]}] run replaceitem entity @s armor.chest minecraft:chainmail_chestplate 1
However, this will only work once the Iron Chestplate is placed onin the player's armor slot.