The Official Novelisation covers this event in a little more detail;
He did struggle, it's just that Vader is uncommonly strong and his struggles were largely ineffective.
- Why did he carry on shooting out lightning?
Palpatine was in extreme pain and doesn't seem to have been able to "turn off" his force-lightning. He was concentrating on the pain of being grabbed, then the shock of being hurled into the chasm.
- Did he intentionally shock Vader?
No. Vader got shocked because he grabbed someone who was using force-lightning. There doesn't seem to have been any intent on Palpatine's part to shock Vader.
At that instant, Vader sprang up and grabbed the Emperor from behind,
pinning Palpatine’s upper arms to his torso. Weaker than he’d ever
been, Vader had lain still these last few minutes, focusing his every
fiber of being on this one, concentrated act - the only action
possible; his last, if he failed. Ignoring pain, ignoring his shame
and his weaknesses, ignoring the bone-crushing noise in his head, he
focused solely and sightlessly on his will - his will to defeat the
evil embodied in the Emperor.
Palpatine struggled in the grip of Vader’s unfeeling embrace, his
hands still shooting bolts of malign energy out in all directions. In
his wild flailing, the lightning ripped across the room, tearing into
Vader. The Dark Lord fell again, electric currents crackling down his
helmet, over his cape, into his heart.