I do not know how to fix your actual problem, unfortunately.
Regarding future preventive measures:
I agree with Greg Hewgill: There are several known data repository corruption bugs in subversion 1.3.1. The last known one being patched in 1.4.6 (and also patched in all 1.5.x and all future versions of course). So you could upgrade to Ubuntu 8.04 (dapper drake), if possible, which comes with subversion 1.4.6 (as well as some ext3 file system patches). If you upgrade to dapper drake, make sure to reformat your ext3 partition with the dapper drake version of the e2fslibs and also do a bad block check with that (this might take several hours on big partitions):
e2fsck -c -c -j /dev/
Also, in many cases it is not subversion being responsible for repository corruptions, but the underlying platform (i.e. the hardware in most cases). Subversion trusts the underlying platform and does not do checksumming by itself. This means that if you really have a valuable source code repository and do not want to have to play back backups of uncorrupted repository backup versions from time to time, than you should invest some money and put the repository on a dedicated box with ECC memory, Solaris operating system and ZFS file system on a 3-way RAID-1 ZFS-mirror (redundant zfs softare raid mirror on three drives). ZFS checksums every bit before it goes to the storage controller, which ext3 does not.
Hardware bit errors do occur again and again in real life. Subversion does not detect those. So you have to use an OS with a file system which does checksumming as well as ECC memory.