Let's begin at the beginning.
You can use 7 buttons (Left,Middle,Right,Scroll Up,Scroll Down,Forward,Backward) if you use the "Microsoft Intellimouse Explorer"
protocol.
Your xorg.conf should look like the following:
Section "InputDevice"
Identifier "My Logitech Mouse Anything in here doesn't make any difference"
Driver "mouse"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/input/mice"
Option "Buttons" "7"
Option "ZAxisMapping" "6 7"
EndSection
This says that you have a mouse that uses the "explorer" protocol and has "7" buttons and scrolling is seen as buttons "6 7"
X normally waits buttons "4 5" for scrolling and "6 7" for forward/backward, so you map the pointer with xmodmap like you did.
xmodmap -e "pointer = 1 2 3 6 7 4 5"
if you run "xmodmap -pp" you get:
There are 7 pointer buttons defined.
Physical Button
Button Code
1 1
2 2
3 3
4 6
5 7
6 4
7 5
So everything should work correctly.
If you want to have all 10 buttons of the MX510 working you need to use the "Event interface (evdev)".
I don't know what distribution you use and which X server you have, so i can't say many details.
If i am correct, debian and gentoo use a patched version of xorg which supports evdev (not very good implemented patch)
so you just change your xorg.conf.
New versions of Xorg X Server have a new and much better implementation.
If you want to use the new version of evdev you can compile it as a module.
http://www.linux-gamers.net/modules/...p?articleid=46
has a very good guide.