Nilpotent and invertible values in semiprime rings with generalized derivations