Local and gap modes of substitutional 3d transition-metal ions in zinc-blende and wurtzite II-VI semiconductors