It is not possible to run commands at the end of a tick. The "load" and "tick" function tags allow only to run commands at the start of a tick. This really limits the possibilities of commands since you might want to wait for the game to process certain events in a tick before running a function in the same tick. It has caused some serious issues with my data pack projects. Please add a new tag to run commands at the end of a tick. Between Block entities are processed and game saving might be the best option. Thank you in advance.
This site is for bug reports only, for feature requests or changes, go to feedback.minecraft.net.