If you're using dual sticks for P1 and P2, you need to "double-up" the inputs by sharing the right side joysticks with P3 and P4; there is no need to make them separate inputs.
Using the iPac4 by Ultimarc as an example:
You can get 8 additional slots if you double up the 3 & 4 player joysticks. The same is true for buttons. (You simply have 2 wires in the same screw terminal and you can double up as many as you want - In my case, I had it tripled up: My 8-way, 4-way and flight stick were all wired into the same input 1p U,D,L,R as well as my player 1 and 2 buttons and my pinball buttons: 1p SW1 and SW2).
In my setup, I have player 1's second joystick on the same input as player 3's joystick. I also have player 2's second joystick on the same input as player 4's joystick. You never use both joysticks at the same time for any games, so it's OK to share the same inputs. (For example if you play The Simpsons, and you touch the 2nd joystick on player 1, you will move the 3rd player since it's using the same inputs. But normally, when player 1 plays they are only touching the player 1 joystick, so player 3 has their own). For games like Smash TV, technically player 4 is mapped as the "fire" joystick for player 1. However, this isn't an issue since it's only a 2 player co-op game. As far as I know, there are no "dual joystick" games more than 2 players out there for MAME.
Hope this helped!
DeLuSioNaL29