Why not just loop through all the Releases with a version that endswith '.0.0' in one loop and do the things to each one? It seems like you're trying to avoid a problem with someone updating one while the script is running, but I'm pretty sure we can control for that by asking, or briefly turning off the admin.