Short answer: It makes sense that P1 is given 4 seconds when it comes back, but that's up to the OS design. It could be given 17 seconds but that's not related to round robin.
Long answer: Let's start with the most basic scenario: Without I/O. Each proccess is given 4 seconds to dance until it's the turn of the next one. This is until one is finished dancing so only the rest of the processes are given turns.
Now, add I/O to it, but suppose I/O is NEVER busy and always instantaneous. Reading from I/O USES CPU time. So process 1 starts dancing for 2 seconds, and then uses I/O for 2 seconds. Then CPU says FREEZE! and process 2 starts dancing. On next P1 turn, it will read I/O for 4 seconds, and on last turn it will only consume 1 second and then say I'M DONE! So it will exit the dancing room.
Let's now take a look at the scenario in which I/O can be busy. Process 1 starts dancing for two seconds and then wants to read from I/O, but it's busy! So it crosses its arms and waits doing nothing for his remaining two seconds. Then CPU works on process 2, then 3 and then goes back to 1. I/O still isn't ready for another 1 second, so process 1 still waits for that second, and then starts using it for 3 seconds. And so on.
Now this "waiting for 3 seconds" is terrible, since it implies the CPU is not doing anything while it could be working on the rest of the processes. To avoid this situatiation, the things go a little different: Process 1 starts dancing for two seconds and then says "I can't do nothing but wait until I/O is ready". So CPU says "no probs, I tell you when it's ready" and goes to next process having P1 only danced for 2 seconds. And works on 2 and 3 until it's interrupted by I/O: "READY BOSS". At this instant it gives control to P1, which uses I/O for 4 seconds, and then the algorithm continues as always.
Now this is the most simple implementation I can think of. Could you write down the time P1 didn't use because it was waiting and then compensate it giving more time when it can run? Well yeah, you can. Round robin doesn't really have much to do with it. It's more about how you decide to treat your interruptions.
And what happens if two processes need I/O? Well, then they can BOTH be put on hold.