Enhancement of the entanglement generation via randomly perturbed series of external pulses in a nonlinear Bose–Hubbard dimer