I have owned a 2006, a 2008, and just purchased a 2010.
The 2006 was totaled by a teen driver last year at around 300-320k miles (not sure because I didn't drive it very often after it became the teen car). Bought it brand new, we did replace the battery (with a refurbished one) after it sit for 6+months without being driven. I loved that car and really wish we still had it. (Purchase Price + Fuel Cost + Maintenance)/miles = ($25,000 + $15,000 + $9,000)/300,000 = $0.16/mile
The 2008 was sold to a nephew who needed a car. Bought it in 2015 with 50k miles and a re-built title for $6.5k, we probably only put about 25k miles on it before we sold it to him for $3k. Again, I wish we still had it, report from nephew is that he loves it (gas and insurance are super cheap). (Purchase Price + Fuel Cost + Maintenance)/miles = ($3,500 + $1,390 + $150)/25,000 = $0.20/mile
The 2010 we have only had for about 1.5 months, it was purchased with just shy of 200k miles. We are putting new shocks/struts on it today actually and hopefully I will enjoy it more after that but I HATE the center console of that generation. I also hate that if SO and I both have a water bottle or some other drink with us we have to slide the console thing back into the kids lap (car seat) to use the 2nd cup holder, or let the water bottle roll around in the floor. This is a small issue in the grand scheme of things but it is really annoying since the Prius has always been our family/road trip car. Bought it for $4.5k, putting $300-500 into shocks/struts so total will be closer to $5k. Not going to do a $/mile right now because it will be very skewed, since we have only had it for 1.5 months.
So my 2 cents, if the 2007 is in good shape I would stick with that generation or skip over the generation with the ridiculous center console that is in the 2013 (gen 3 2009-2015, I think).
If you want to do straight $/mile cost for you I would pick a # miles that you think you will drive either car for and figure it out assuming you will sale/total/get stolen at a certain mileage.
(Purchase Price + Fuel Cost + Maintenance)/miles - Lets assume you will drive both cars until 250k miles, I will use a fuel cost of $2.5/gal (and average mpg of 45), and maintenance of $30 every 5,000 miles for oil change/tire rotation (do them yourself) and tires every 50k miles @ $600.
2007
($6,500+$6950+ ($750+$1200))/125,000 = $0.12/mile
2013
($12,000+$9450+($1020+$1800))/170,000 = $0.14/mile