How to temporary lock access to certain branches?

How can we accomplish the following in GitLab?

A release freeze: ReleaseA
ReleaseA might point to various protected branches among many repositories. The branch name might be different among each repositories.
RepositoryA > V1.0
RepositoryB > V2.1
Here both RepositoryA V1.0 and RepositoryB V2.1 is part of ReleaseA.

Given a list of repositories + branch:
– Limits push access to given freeze maintainers

I guess we would need to make a script to do this, utilizing the GitLab API.

Since access is done through protected branches, I see no way to do this without changing the repository protected branches configuration.
First Set Allowed to merge and Allowed to push to No one, then set specific users only to Allowed.
We then need to remember each repository configuration somehow, for when freeze is unlocked it should go back to as it was.

Can we keep the existing protected branches configuration, but add a more restrictive configuration that will override it?
Then we do not need to remember the configuration, just add the specific branch to protected by only selected users.