If you're using PackageKit on top of yum, you can do it with pkcon
:
% pkcon repo-disable myrepo
Enabling repository [=========================]
Waiting in queue [=========================]
Waiting for authentication [=========================]
Waiting in queue [=========================]
Starting [=========================]
Getting information [=========================]
% pkcon repo-enable myrepo
Enabling repository [=========================]
Waiting in queue [=========================]
Waiting for authentication [=========================]
Waiting in queue [=========================]
Starting [=========================]
Getting information [=========================]
Downloading repository information[=========================]
Note that, as the output indicates, running the command as a regular user typically means you'll be prompted for authentication before it'll complete.