Replacing through-the-wall air conditoner
First, if it works even at all, check with your power company about any appliance upgrade assistance they may have.  They will often subsidize replacement with efficient appliances, especially air conditioners, because every watt of A/C draw they eliminate is a peaking unit power plant they don't have to build. Peaking units are by far the most expensive because the bank wants the mortgage paid exactly the same as a baseload 24x7 nuke, but the peaking unit only makes hay a few hundred hours a year. 

There's window units, and then, there's wall units.

Wall units are much tougher and more industrial units than window air conditioners.  They also have a much tougher and more industrial price :) 

As such, people like to substitute for window units, which is not a good idea. Window A/Cs assume a threshold only a few inches wide, especially on the top.  The wall passage tends to be deep, and the window unit won't perform well there.  

One could install a window :)