First you should check out the optimizations in the Multivariate Priors for Hierarchical Models section of the Stan User’s guide, specifically the optimizations that are presented later in the chapter. Then you should take a look at the reduced-computation-through-recognizing-redundancy trick I present here.