it really depends on what you want to do with the car. If you just need it for a daily driver, any year will do but there are some things you may want to consider. The ka24 engine is probably one of the heardiest engines out there, it will keep going nearly forever. I know there are a few members here with well over 200,000 mi on their ka. There are a few minor issues with them, like the timing chain guides and tensioners (search for details), but nothing that should stop you from getting one. As for which year to get, again, it depends on what you like and are looking for. Cost wise, you can check a bluebook for an approx value, try
www.kbb.com (<- usually runs a bit high unless car is perfect) but for a first car you probably shouldn't spend more than a few thousand on it. Keep a lookout for cars on the internet and around your town, they usually go quick unless something is wrong with them. Look through the forums and see what other people are doing to their 240s and and see if any of this sounds like what you want to do. When you find a car you want, go after it, but let a mechanic look at it (very important.

I know from experience)