The difference between choices is so subtle that if we do not go literal and precise about meaning, we will be in trouble. Let's try our best
A. a period when - generally, we use "when" to refer to a specific point of time. In other words Aghata wrote her books at certain specific point and not during 20 years. Not intended meaning.
A is goneB. in which - "which" must refer to noun but there is no noun close by. Thus, this
option is wrongC. during which - again, "which" has to refer to noun, but no none is placed anywhere close by.
WrongD. when - as in A, when must refer to certain period of time, but meaning wants to convey that Aghata wrote book during 20 years, not at one certain point.
EliminateE. a period during which - perfect, here we have "which" that refers to period (20 years) and "during" that refers to that period during which she wrote her books.
Meaning and grammar are correct here.
Answer is E.