I learned then that sudo was really just a binary, so I tried to get a copy and put it in the right place. I couldn't, though, because I didn't have write permissions to it without sudo!
In hindsight I guess I could've just run the binary itself to get access, or put it elsewhere on my $PATH, or use `su` instead. Not sure if I tried those things, it was a while ago and I was pretty new to Linux. Maybe I got the file from the internet and didn't know to make it executable.
Anyway, what I ended up doing was booting up from a live Ubuntu USB and copying the sudo from the live environment to my installation on disk. It worked, and my newbie self felt like a proper hacker, fixing the unfixable. For one day I was a heart transplant surgeon :)
I was certain that the laptop was dead and I will not able to use it anymore since I will not be able to install new system. So the task was to copy somehow all my important data. Luckily I was using Firefox and I've had FireFTP installed, so I've borrow my mother Windows laptop and installed FTP server and was able to copy my data over WiFi. Later it turns out that you could buy used DVD burner for that laptop, so it was resurrected and after installing Windows XP I've given that laptop to my mother.
I could still access the block devices, but couldn't instantiate the logical volumes, and dumping dd chunks showed that there was data there... so I wrote some code to scan the disk for ext2 magic numbers, and once I found them did some math on paper to find the partition boundaries and very... carefully... recreate them. I have a photo of the piece of paper here: https://www.flickr.com/photos/jedwards/4494268626/
(And its HN thread, with other recovery stories: https://news.ycombinator.com/item?id=25491790)