Excited state structural analysis (ESSA) for correlated states of spin-flip type: application to electronic excitations in nanodiamonds with defects