There's no easy way to troubleshoot this without another keyboard (or another old mac that uses that type of keyboard). You'll be pretty limited in what you can test for. That said...
Just look carefully at all connections. Look at the plug, look at the jack. Clean/repair/replace as necessary. Open up the keyboard. Look at its internals, especially where the cable connects to the circuit board.
Use an ohmmeter to verify that there's no broken connection from the plug pins to the keyboard's internals. All four pins need connectivity (unlike a phone, which only needs the middle two).
Just look carefully at all connections. Look at the plug, look at the jack. Clean/repair/replace as necessary. Open up the keyboard. Look at its internals, especially where the cable connects to the circuit board.
Use an ohmmeter to verify that there's no broken connection from the plug pins to the keyboard's internals. All four pins need connectivity (unlike a phone, which only needs the middle two).