Interesting things:
+2 -> 785 = 1023 - 252 + 14 - 2 + 2.
+14 -> 1053 = 1279 - 252 + 14 - 2 + 14.
+106 -> 1401 = 1535 - 252 + 14 - 2 + 106.
+252 -> 2059 = 2047 - 252 + 14 - 2 + 252.
I saw this pattern.
This is what might have happened.
For the fourth egg, Peterko must have got another egg after 253 or 254 steps carrying it. Thus the game step counter resetted to zero. After walking 254 or 253 more steps, he boxed the egg. Thus, the internal counter for egg 4 was still 5.
For the other eggs, the move counter reached 255 once, so their internal counter is 3.
When Peterko got out all the eggs again, the internal step counter must have been 239.
So, so far, we have:
Egg 1: 257 steps (255+2). Internal counter: 3
Egg 2: 269 steps (255+14). Internal counter: 3
Egg 3: 361 steps (255+106). Internal counter: 3
Egg 4: 507 steps (255+252). Internal counter: 5
Step counter: 239
Peterko now got the four eggs out, and placed them in the order determined by the egg number. He now walks 16 steps, and the step counter reaches 255, so the egg counters are decreased by 2. So now we have:
Egg 1: 273 steps. Internal counter: 1
Egg 2: 285 steps. Internal counter: 1
Egg 3: 377 steps. Internal counter: 1
Egg 4: 523 steps. Internal counter: 3
Step counter: 255
He walks 256 more steps, and the egg counters decrease by 2 again:
Egg 1: 529 steps. Internal counter: -1
Egg 2: 541 steps. Internal counter: -1
Egg 3: 633 steps. Internal counter: -1
Egg 4: 779 steps. Internal counter: 1
Step counter: 255
After moving 256 more steps, we have the following situation:
Egg 1: 785 steps. Internal counter: -1 <- Hatches
Egg 2: 797 steps. Internal counter: -1
Egg 3: 889 steps. Internal counter: -1
Egg 4: 1035 steps. Internal counter: 1
Step counter: 255
The internal counter of the first egg is less than 1, so it hatches. Notice that the egg counters are NOT decreased.
256 steps later, we have the following situation:
Egg 2: 1053 steps. Internal counter: -1 <- Hatches
Egg 3: 1145 steps. Internal counter: -1
Egg 4: 1291 steps. Internal counter: 1
Step counter: 255
The internal counter of egg 2 is less than 1, so it hatches. Again, the egg counters are not decreased.
256 steps later:
Egg 3: 1401 steps. Internal counter: -1 <- Hatches
Egg 4: 1547 steps. Internal counter: 1
Step counter: 255
The internal counter of egg 3 is less than 1, so it hatches. Again, the egg counters are not decreased.
256 steps later:
Egg 4: 1803 steps. Internal counter: -1
Step counter: 255
The internal counter for egg 4 is decreased by 2. Finally, 256 steps later:
Egg 4: 2059 steps. Internal counter: -1 <- Hatches
Step counter: 255
Egg 4 hatches.