how to optimise code?

You could create a function and use that. You could even combine it with one of the purrr::map() functions.

Otherwise, for the last bit:

word_year <- word_year %>% mutate(sev_word=(sumVAprod_word/sum_repet_word), # V+A
                                  aro_word=(sumAprod_word/sum_repet_word), # A
                                  val_word=(sumVprod_word/sum_repet_word)) # V

Anyway, a reproducible example of df_word2 and word_year would help.