There is a story as to How blinking of eyes came into existence. The story is of a King Nimi, father of King Janaka, Sita's father. The story is mentioned in-
Devi Puraanam- Chapter 15, Book 6
Vishnu Puraanam- Chapter 5, Book 4
Bhaagawata Puraanam- Chapter 13, book 9
Matsya Puraanam (Chapter 61), Padma Puraanam(Chapter 22, Book 1) also mention it with a slight variation.
Maybe in other Scriptures too. ;)
The story in short is this-
- King Nimi wanted to do a Yagya, so he asked his Guru Vashishtha to conduct it.
- BrahmaPutra(Vashishtha, son of Brahma) was appointed by Indra already, so he told the king to wait.
- The King Nimi did not wait and conducted Yagya with Gautama and other Rishis.
- When MaitraVaaruni got to know this, he cursed the king that you may become bereft of your body(i.e. you will not have any body).
- The King also cursed Vashishtha that your body may also collapse.
- Then Vashishtha's body(born of BrahmaDeva) gets reborn again out of semen of Mitra and Varuna(and since then Vashishtha is called MaitraVaaruni).
- The King's body also collapsed, but the sages completed the Yagya, keeping King's body preserved with Mantras, and balms and resins.
- Then, Devas arrived to confer boons of Yagya, so all Rishis asked them- O Immortals! give back life to King.
- But Nimi asked the Devas- I do not wish to have a body, as body is receptacle of all sufferings.
- So the Devas established the King Nimi as the air in the eyes of all beings, due to which we constantly open and close our eyes(id est- we blink our eyes).
So this is a story How Janaka's father Nimi got established in our eyes to make us blink.
This is interesting how some of body functions happen.
Also there is mention of how Yawning's ;O originated, mentioned in Devi Puraanam, Book 6, Chapter 4-
When Vitra and Indra fought, Vitra swallowed Indra inside his stomach.
To save DevaRaaja, the Suras created "Yawning". Vitra, due to Yawning, yawned and when his mouth opened Indra came out and fought again.
Since then, this "Yawning" occurs in all beings.
So, is there any mention of Laughter? How was it created, what was its purpose et cetera? Are there other functions in body that too have these divine origins?