Translation:I am between the cow and the horse.
You can only say "ed" when it's before a vowel, but you're not forced to use it at all; in literature they have different usage as e+vowel becomes a diphthong while ed+vowel becomes a new syllable (which is important in poetry), but when talking you pick one depending on personal style and aesthetics. Usually one tends to avoid double vowels (i.e. e+e, a+a), for instance "e è" is less common than "ed è", but that isn't set in stone either.
No, there is no rule and no clear distinction of politeness/formality/literacy: the usage between same vowels is advocated by most grammarians (http://www.accademiadellacrusca.it/it/lingua-italiana/consulenza-linguistica/domande-risposte/d-eufonica) but not consistently followed even in literature (http://www.mauriziopistone.it/testi/discussioni/gramm01_d_eufonica.html). In particular in that last link the quote from Satta (journalist and linguist) recommends "a esempio" or "a Adamo", whereas "ad esempio" and "ad Adamo" are most common.