In terms of prices, I can't really remember much except that Madrid is a LOT cheaper than Barcelona! I would say you need at least 2000 US for 2 months, and probably more if you're planning to party a lot. But again, that's a rough estimate. I remember one night I went to a "nice" club and it was 15 euro cover to get in, so yeah, I only did that once! Look for specials and stuff or drink before you go out...buying drinks out can really hurt the budget.
I agree with Mike's suggestion for daytrips.
Lisbon is wonderful, and I loved Portugal in general. It's not too far away from Madrid and Portugal is cheaper than Spain. I also loved Porto, in the north.