1) Purpose of adding om shanti and Meaning of om shanti
Shanti literally means 'peace' in sanskrit and ॐ(aum) is the word which describes everything we can see, touch, feel, deduce(logic) etc(i.e. the whole samsara physical as well as mental relam).
It(ॐ) also represents brahman(Omnipotent god).It is believed that omkar created everything it is shabda brahman (god in the form of word), that is why omkar ॐ is equivalent to samsara(and everything in it).
more on ॐ
Peace means that sadhaka has no Virtti in mind so that mind does not dwell in material world and is ready to attain salvation.
While Chanting the omshanti mantra (which is done at the end of any shantimantra) we want to make peace with everything, it concludes that 'everthing is peace', if everything is peace you don't have to find peace outside. Peace making is important before any Yagna-Karma (including karma-kanda or simple literature reading japa, dhayan, pranayam etc) to get the essence and attain moksha through that Yagna-karma.
Yagna : Yaj means to worship. Shrimad Bhagawad Geeta presents Yajna as method of One Eshwar (God or Supreme Reality) worship. This worship involves always thinking about only One Eshwar that lives in the heart of all human beings.
So in order to do yagna we have to be in a totally peaceful state.
This will make it clear why I call it yagna karma.
3) Why is it written only three times?
Three is the count of the total no. of lokas viz bhu(earth/mrutyu-loka), bhuvar(hell), savha(swarga)
This talks more about lokas.
Reciting it three times makes the three lokas peaceful, they(lokas) represent our mental stages which are to be made peaceful (Without any thoughts just brahman/god) in order to gain moksha the ultimate goal.