How to choose optimal number of regimes for MS-BSVAR?

Thank you in advance.

There are no general guidelines. You could work from marginal data densities or similar criteria to determine the optimal number. But in practice people often have a strong prior and go for a small number of regimes as the data is often not sufficiently informative to provide insights into a bigger number of regimes.