I've always heard it's from midaevil (sp) times when people used to try to poison others all the time. If you clinked your glasses or mugs together, that would make the liquid slosh around into everyones glass and mix it up. The theory being that if you had just poisoned one of the mugs, the poison just sloshed into your mug.
I've never heard of it as pagan to ward off evil.
http://www.german-toasting-glasses.com/information_library/glass_clinking.html