Toggling the syncing of Gmail for the account is the best option. Turning of Gmail sync on a Google account in Android does not prevent you from fetching mail for that account via a method such as "pull to refresh" when you are viewing that account in the Gmail app.
I use Synker to integrate with Tasker, though I know there are other apps that expose Tasker control of specific sync settings on an account by account basis.
The basic outline I have is as follows:
- A profile named "Work" whose conditions are a combination of a time, 9am-5pm, and a Date, Mon-Fri. It has the same entry and exit task.
- A task named "Work" that has two items: one to set the sync options of my work Google account to have Gmail sync on that is conditional on
if %PACTIVE ~ *Work*
, one to set the sync options of my work Google account to /not/ sync Gmail if %PACTIVE !~ *Work*
If I want to read work email when sync is not on for that account, I just open Gmail, switch to that account, and swipe down ("pull to refresh"), fetching the messages from the server.