In the iambic meters of both Greek and Latin plays, if the final syllable of a foot is long, the ictus falls there–otherwise it falls on the penultimate.
Although there are typically six feet in a Latin iambic, editors customarily place an accent mark only on the odd feet of the verse, e.g. from the first line of Terence’s Andria:
Poéta quom primum ánimum ad scribendum ádpulit,
(I’ve never heard a good explanation for this, but I suspect these ictuses are what drive proper recitation; note in this line that quom, scri-, and the final syllable -lit also receive an ictus, and none of these can be said to have the natural stress accent). A later line in the play starts with in mémoria habeo…, a clear example where the primary ictus does not conicide with word stress. From my reading, I’d say that the primary ictus usually matches a stress-accent, but not always…
The evidence is strong that pronunciation was influenced by nearby words (at least in poetry and other metrical forms). But these are comic plays, and they may have deliberately mispronounced a few words as part of the fun. The one point I am absolutely convinced on is that enclitics like -que, -ve, -ce, -met, etc. changed the accent of the word to which they were attached; there are far too many examples of verse accent changing for enclitics to be simply chance.
Not sure, but there’s likely a bit of To-MAY-to/To-Mah-to in this. And even in Rome itself, pronunciation varied with class and tribe, so a writer might be “borrowing” a form that isn’t universal, much like how a modern English writer can use two different pronunciations of the word “route” to fill out a rhyme.
I’d bet these exceptions–like an ī falling in a naturally short place in the verse–were glossed over in several different ways depending on the speaker (synaresis, shortening, pronouncing them like “grace notes”, or emphasizing the incongruity for comic effect).