I would suggest that if the laptop is working well for you and not showing much more trouble other than the keyboard you can safely replace it.
The only other part of the laptop I would be overly concerned about would be the hard drive. Being 5 and 1/2 years old, it has just about reached its useful life and may fail in the near future. But, it's also possible that it could continue running properly for the next year or two. Replacing the keyboard on your Toshiba laptop is actually pretty easy. I was able to find disassembly instructions for your M35. They are located here.
You will pay close attention to steps 8 and 9 in these directions to get your keyboard out. Once you remove the strip in the pictures, you will find 3 screws holding the keyboard. A closer look can be found here
in steps 10 through 12.
You do not have to go any further with disassembly of your laptop than step 12. Reverse the directions to put the keyboard back in the laptop and you should have your machine up and running like it's supposed to be. I found a replacement keyboard here.
As you will see they're not that expensive.
As far as whether or not it is foolish to repair your laptop or not, I would say no it is not. You will be spending a small smount of money to get it back and working properly and who knows, it could last you for another few years with proper care.
If you replace your laptop with a "NEW" machine, you should be able to reuse most of your software but I would be hesitant to install the older programs on something that has say Windows 7 on it. It is possible that you would end up with more compatibility issues than enough and would be better off buying the programs as new in their newer versions to go with your new operating system if you went that direction.
Hope this helps,