Ergodicity variation in a long range interacting one-dimensional Ising spin system subject to a time-varying magnetic field