Hi oldwhitewood,
I've had a look at the ebay link. You know I'm not 100% sure but I think that this lens does not have a motor. The -D designator is one of those features that started Nikon on the wrong path. The -D means that there is a metal contact through which the lens passes distance-to-subject information to the camera. This is supposed to help with exposure information but in reality this feature doesn't really help except if you are taking a flash picture pointing at a highlly reflective subject, like a mirror. The lens is is reported to be very sharp and is an excellent buy but I suspect you will have to manually focus with a D40 because nowhere in the specs does it say AF-S. As I said before, it will meter perfectly, no problems there, but you may struggle to get pinpoint focus in low light situation if your vision is not perfect, especially if you are using wide open apertures which limit your depth of field to begin with.
I would definitely get the lens at those low prices, but it would not be my only lens. Another option would to use the money you save with this lens and get a used D70 body that has a motor. This elliminates a lot of AF issues but the penalty is weight. It just depends on what feature are important to you.
If AF is important to you and if price is an issue then it might be better to get the kit lens 18-55 AF-S with this body. I think Dave mentioned he has this lens and has had great success.
I understand what you want to do with the large apertures, isolate subject from background and so forth but generally, if you are shooting ferns and roots at close distances, depth of field falls off the wagon anyway so that even at f5.6 you can still do a decent job of it.
Cheers,