The PS2 cord if my trackball has not end on it, just wires. Where/how do these attach to the opti-wiz?
The short answer is that they don't.
PS/2 mice and trackballs already have encoder boards in them. They only need 4 wires (like your picture shows) to connect to the PS/2 port, instead of the 6-8 wires that encoderless trackballs need to connect to an encoder board.
I know you already got the opti-wiz, but you don't need it for this -- unless you REALLY want to bypass the built-in encoder board. (Not worth the effort.)
If you can get a PS/2 cable with a good connector, I would recommend cutting it off at least 10-12 inches from the connector and splicing the old cord to the new cord. The attached diagram shows how to use the cords to keep the splices from pulling apart. After you have spliced the wires together and have it working properly, hold the trackball cord (black) to the replacement PS/2 cord (red) with several tie straps (blue) -- shown here untightened for ease of understanding. Be sure to leave a gentle bend >=6 x diameter of cord where the cord doubles back to avoid breaking wires.
This Wikipedia entry should help if you already threw out the crushed connector. The required connections are on the right side, just a little way down with a very clear pin diagram to guide you.
Pin 1 +DATA -- Data
Pin 2 Not connected -- Not connected*
Pin 3 GND -- Ground
Pin 4 Vcc -- +5 V DC at 275 mA
Pin 5 +CLK -- Clock
Pin 6 Not connected -- Not connected**
* On some computers mouse data for splitter cable.
** On some computers mouse clock for splitter cable.
Not sure if both PS/2 cords will have the same wire colors. If not, hopefully, you can look where the cord attaches to the encoder board inside the trackball and determine which wire is 5v and which is ground. once you get those two sorted out, you can try the other two one way and if it doesn't work, swap them.
Scott