Collective excitation modes in the intermediate and superconducting states of doped and undoped indium and lead