Well, on Dell's website, the specs of the Dimension 5150 are as follows:
Intel Pentium 4 3.0GHz-3.4GHz
512MB DDR2 RAM
Intel GMA 950 or an ATi Radeon X300 SE or X600 SE
305W Power supply
Considering that your motherboard has a PCI-e 16x slot, you could really just put any decent graphics card in there, although your CPU will hold it back - it'll be too busy catching up with the graphics card that your FPS will still be pretty low. If you just want to play L4D2 and COD:MW2, and meet the bare requirements, all you'd need is some low-end to mid-range graphics card - something like an ATi Radeon HD 4350, HD 4550 or HD 4650 would be more than enough I'd say to meet the minimum requirements. Buying another stick of 512MB DDR2 RAM would give your computer a nice boost too, so in total you'd have 1GB I believe.