Honestly, being reasonable, even if this shader isn't optimized: when will you ever need in a game a room or dungeon where you need such a lot of dynamic lights?
I think there's always a way to reduce the need of 4 dynamic lights to very few rooms.
Did anyone try to reduce the textures to 256x256 to compare the framerate to the current framerate?
EDIT: [To make a contribution, which isn't optimized in each detail seems to be quite risky! Only trouble!

]
Suggestion about optimizing, in case one uses a big dungeon with a lot of torchs and several gaps in the roof with sunlight:
Everything shadowmapped with ventilator's plugin, but when you come closer to a enlightened place switch the dynamic light to it to see the normalmapping.
It is a bit like done in the sphere plugin, with the important advantage that it doesn't disappear in the dark as soon the dynamic light switches off.