For the second part of the code your wrote out, you have to add in the right hand check to the next class as well. It should look something like this for each class:
if((ep == EQP_HAND_R && (pc_checkskill(sd,AS_LEFT) > 0)) && (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN ||
(ep == EQP_HAND_R && (pc_checkskill(sd, AS_LEFT) > 0)) && (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO ||
(ep == EQP_HAND_R && (pc_checkskill(sd, AS_LEFT) > 0)) && (sd->class_&MAPID_THIRDMASK) == MAPID_KNIGHT ||
(ep == EQP_HAND_R && (pc_checkskill(sd, AS_LEFT) > 0)) && (sd->class_&MAPID_THIRDMASK) == MAPID_ROGUE ||
Also, if you're going to do it that way they have to have the skill added to their skill tree and have at least a point into it, which involves editing the skill trees in the other text files. To my knowledge, nothing you've added there would add the skill. So, you could either remove the skill check and class checks from the equation, which would basically allow any class to dual wield at any time, or you could add it in like above for every class, but remove the skill check portion.
That's how it worked for me at least. I think the main point is the ep == EQP_HAND_R part. That's what seems to check that a weapons already in the right hand and moves on to equipping one in the left hand.
It still hits for two, but as far as I can tell the third chunk of code staggers the second hit. So you do still hit twice, it might just look like it's not. Try attacking something when you're aspd is really low and see if it's just overlapping very close.