Here is a MATLAB based app to help look at the finance aspects of buying a house.
Here is a .zip file containing an .exe that can be run independent of MATLAB; however, the MATLAB runtime library needs to be installed. The app is still a work in progress, so ignore spelling errors! (or don't).
How the code works
When you open the app, the code will display some text on the right hand side and produce a graph on the left. The scenario displayed when you first open it, is just an example scenario. The three tabs "Property details", "Mortgage details", and "Payment details" contain entries that will likely change depending on the property you are looking at. There are more detailed settings that can be adjusted under the "Advanced settings" tab.

The graph on the left is a plot of value vs. time. The green curve is the equity in the property (note that the curve does not start at zero, that is because there was a down payment involved). The dashed line is the value of the home over time (by default, it is assumed that it increases in value by 1% per year). The red curve is the amount you are "in the red" (i.e. your debt + the costs you will not recover such as cost of buying and selling). The vertical, solid black line represents the "break even" time. This break even time is calculated as the time when the growth in equity is equal to the cost of buying and selling the property.
The text on the right is nuanced and hopefully self explanatory based on the words themselves. I added a quick explanation of all entries in the "tooltips" if you hover the mouse over the entry field.
How to edit the code

If you are interested in seeing the guts of the code or how I am doing the calculations, here is the source code .mlapp file (contained within a .zip).
To edit the source .mlapp file, first save it as Mortgage.mlapp somewhere on your computer, then open MATLAB and hit New then App then open the file. Once open, you can navigate to Code View and scroll down until you find the function called Calculate(). This function is where all of the action is.
Enjoy!