Monte Carlo simulation of nonstationary transport of ultracold neutrons in horizontal neutron guides and the storage of ultracold neutrons