"It was while Grandmother was still alive."
Translation:Det var medan farmor fortfarande levde.
Because it is a subclause.
Main clause: Farmor levde forfarande.
Subclause : Det var när farmor fortfarande levde.
Just to clarify, not all adverbs/phrases go before the verb in a subordinate clause, right? Only the so-called "sentence adverbials"? Of which fortfarande happens to be one: https://blogs.transparent.com/swedish/swedish-sentence-adverbials/
My guide for Swedish word order: https://learningswedish.se/courses/1/pages/clauses