I had a few minutes so I threw together this
spreadsheet - rent_v_buy.xls.
It allows you to specify a time horizon, interest rates, rates of appreciation, etc.
I've not thoroughly audited the sheet, so caveat emptor. But if you find any mistakes or want to question my assumptions, please let me know!
Don