Dear N:
You wrote:
1-He smoked a cigar when he wrote a poem.
2-He smoked a cigar every time he wrote a poem.
Can’t these sentences have two meanings:
a-He smoked a cigar after he wrote a poem.
b-He smoked a cigar while he wrote a poem.
Yes, they can. That is why we sometimes use other words to make such things clearer like “while” or “whenever.” Presumably, if the speaker or writer were just using “when,” the context would make it clear. For example, “He smoked a cigar to celebrate when he wrote a poem,” would almost certainly mean “a” since it has been a tradition (though not as popular as it used to be) to light a cigar after any significant accomplishment (having a child, winning a sports championship, getting promoted).