Step 1: Set up using the work formula
For each straight piece, work done by the gas is $W=\int p\,dV$. On the vertical sides $V$ is constant, so no work is done there. Only the two horizontal sides count.
Step 2: Lower horizontal side
On this side the pressure is $2P_0$ and the volume goes from $3V_0$ to $5V_0$. Work: $W_1=2P_0(5V_0-3V_0)=4P_0V_0$.
Step 3: Upper horizontal side
On this side the pressure is $4P_0$ and the volume goes from $5V_0$ back to $3V_0$. Work: $W_2=4P_0(3V_0-5V_0)=-8P_0V_0$.
Step 4: Add up
Net work: $W=W_1+W_2=4P_0V_0-8P_0V_0=-4P_0V_0$. The negative sign only reflects the direction of the loop. The magnitude is $4P_0V_0$.
Final Answer:
The magnitude of work done is $4P_0V_0$, option (B).
\[ \boxed{4P_0V_0} \]