If you do not need to sell for the cash to upgrade, then i say forget it. Keep it because there are too few decent digicams nowadays. Between the S40 and the S50, there are very few improvements worthy for you to lose $400.
Even if you want to upgrade to a DSLR, i suggest you still keep the S40, because nothing beats the portability of the small digicam as a useful tool for inconspicuos shooting. It is not everyday you lug around your DSLR setup everyday.