Wash it first, always
A rug going into storage carrying food residue, perspiration, pet oil or soil is an invitation to moths, which are drawn to soiled wool far more than to clean wool. Anything organic in the pile also has months or years to react with the dyes. Washing before storage costs the same as washing at any other time and prevents the two most expensive storage outcomes.