I just experienced the exact same problem with my D40.
I sold it because I saw that the prices were going down, down down in BnS, the shutter count was increasing with use(duh) and I felt it was time to upgrade to D90 due to better ISO capability and more AF points. Not to mention the ability to live view. And not sure if it's my imagination but when i tried it out, I thought it's easier to focus for certain subjects because D90 has this thing with the center AF zone wider so it's easier to track focus accurately.
Btw, I sold my D40+kit lens for 370, after a few weeks of reposting, after tenmillionthousand people quoting me 300 for it. (I set original price at 400 for 10/10 set with no user marks) Be prepared for these lowballers and dead buyers if you haven't sold on BnS before.
From my observations, secondhand D90 is actually decreasing in price as well, as compared to D7000. A lot of people selling off their D90 bodies as they want to upgrade.
Have you tried out the 50mm 1.8 lens? I personally find the focal length WAY too far away, you wouldn't be able to use it indoors or in tight corners. It wouldn't be an everyday lens for me. I bought the 35mm f1.8 lens for my D40 and I never regretted. Even the 35mm f1.8 lens still gotta stand a bit too far away for taking normal pictures of 2 friends together, let alone the 50mm f1.8. Definitely try out both focal lengths before making a decision, there is a really big difference/I personally cannot live with 50mm f1.8 as everyday lens on crop body. I saw that a few people bought 50mm f1.8 lens from BnS because it was cheap, but ended up selling again due to not being able to get used to the focal length.
Secondly, the 50mm f1.8 and the 35mm f1.8, I feel there's a good reason why they are priced differently, one is 3 times the price of the other. I never understood "glass makes a difference" or "good glass is more important than body" until I saw it for myself. You are getting what you pay for. I personally feel d40x+35mm f1.8 would be better than d90+50mm f1.8, I mean the obvious part is the focal length, which already makes the decision for me, but then the quality of the image and the build of the lens.. subjective, but after I borrowed 50mm from a friend, I prefer the 35mm 1.8 images over 50mm 1.8 images myself. Best would be to get d90+35mm f1.8g together which was my original decision.
You're basically fine with the D40x and no problem with the camera body/don't see a need to upgrade, right? Do you see yourself being satisfied with the 35mm f1.8 lens+D40x body in the long term? Anyway, you can always decide whether or not to upgrade your body since 35mm f1.8 can be used on both bodies. 35mm f1.8 on D40x would definitely be able to take great shots indoors if that's what you need.
Do you have any other needs for lenses or any other lenses that you are thinking of saving up for? Personally, I can happily continue with just d90, 35mm f1.8 and sb-700 for the rest of my camera life, I am not a fan of zoom lens due to my own usage/preferences. I was actually reluctant to part with my D40, but I felt I needed better ISO and more AF points.