How can I reinstall Mac OS 10.5.8 without erasing data?
You should be able to reinstall the OS without it deleting any of your personal files (those in your User folder); it's one of the install options available from the OS installer. This option only changes System and other files that belong to the OS). 

(Of course, be careful not to select a full erase/reinstall option. And a full time machine backup is still highly recommended. If things go wrong, you can then do a full erase/install, and the installer will prompt you to restore personal files via your time machine backup.)