What would happen to a non-Dalit if a Dalit touched them in Ancient India?
First of all, the word "Dalit" is not an ancient Sanskrit word. Like the word "Harijan", "Dalit" is a word used by so-called anti-caste "reformers" to attack certain aspects of the caste system they disagreed with. So Hindu scripture doesn't talk about the word "Dalit", but it does talk about Chandalas. Here is what Bhishma says about Chandalas in this chapter of the Anushasana Parva of the Mahabharata:
If a Sudra unites with a woman belonging to the foremost of the four orders, the son that is begotten is called a Chandala. Endued with a fierce disposition, he must live in the outskirts of cities and towns and the duty assigned to him is that of the public executioner. Such sons are always regarded as wretches of their race.
More detail is provided in this chapter of the Manu Smriti:
But the dwellings of Kandalas and Svapakas shall be outside the village, they must be made Apapatras, and their wealth (shall be) dogs and donkeys. Their dress (shall be) the garments of the dead, (they shall eat) their food from broken dishes, black iron (shall be) their ornaments, and they must always wander from place to place. A man who fulfils a religious duty, shall not seek intercourse with them; their transactions (shall be) among themselves, and their marriages with their equals. Their food shall be given to them by others (than an Aryan giver) in a broken dish; at night they shall not walk about in villages and in towns. By day they may go about for the purpose of their work, distinguished by marks at the king's command, and they shall carry out the corpses (of persons) who have no relatives; that is a settled rule. By the king's order they shall always execute the criminals, in accordance with the law, and they shall take for themselves the clothes, the beds, and the ornaments of (such) criminals.
And here is what Vyasa's father Parashara says in this chapter of the Shanti Parva of the Mahabharata:
The man of intelligence would never do an act that is sinful in character even if it leads to the greatest advantage, just as a person that is pure would never touch a Chandala.
Now this may harsh treatment of Chandalas may seem unjustified on the surface, but it's completely justified once you take reincarnation into account. The Chandala did heinous acts in past births to deserve to be born as a Chandala; here is what this chapter of the Manu Smriti says:
The slayer of a Brahmana enters the womb of a dog, a pig, an ass, a camel, a cow, a goat, a sheep, a deer, a bird, a Kandala, and a Pukkasa.
This chapter of the Chandogya Upanishad says much the same thing:
Those whose conduct has been good, will quickly attain some good birth, the birth of a Brâhmana, or a Kshatriya, or a Vaisya. But those whose conduct has been evil, will quickly attain an evil birth, the birth of a dog, or a hog, or a Chandâla.
In any case, the situation of a Chandala is not without hope; here is what Krishna says in chapter 9 of the Bhagavad Gita:
O son of Pṛthā, those who take shelter in Me, though they be of lower birth – women, vaiśyas [merchants] and śūdras [workers] – can attain the supreme destination.
So I encourage everyone, Chandala and Dvija alike, to perform Sharanagati.