Transfueler--I believe you have accurately identified the reasonable choices and horsepowers. To bound your choices and confirm, I offer my experience on my 1975 Revenge 19.
My boat is heavier and has more windage and hydrodynamic drag than yours does. I have had a 9.9=HP two-stroke outboard since the boat was new in 1975, first a Johnson, then an Evinrude. A 9.9-HP is adequate in all sea conditions and wind conditions I have experienced, and we have used it extensively for trolling. Normally we operate at about two-thirds-throttle to move the boat at 5-nautical-miles-per-hour. [Boat speed] will max-out at 6-nautical-miles-per-hour depending on boat load and wind. I consider [a 9.9-HP engine] a great choice for my boat; it weighs 72-lbs.
Although the current engine, a 1985 Evinrude 9.9, is adequate, the same engine is also available in a 15-HP version. I run a lower pitch 9 x 9 propeller to get the [engine speed] up to where it needs to be for proper power output and thrust.
Of course this engine is larger than what you need on your 17, so I would consider it an upper bound. Since you are using the engine mostly for get-home safety factor, you probably can get by with less weight and lower horsepower. And 1980-and-later engines in the same power and weight range are widely available, are easy to fix, to overhaul, and are very dependable.
As a lower bound, 4-HP is probably too little for you. I have a classic wood 16-foot Lyman lapstrake runabout. I carry an 1974 Evinrude for emergency power. The engine is so light--35 lbs--I don't even keep it on the transom. I carry it inside the boat and when I want to use it I put it on the transom. I run it every trip to keep it fresh and operable. It will push the boat at 4-nautical-miles-per-hour at full throttle with a standard right angle drive lower unit (as opposed to the weedless lower units also available on the old 4's) and run an 8 x 4.5 three-blade propeller. These engines were produced in models called Lightwin and Yachtwin versions, with the latter intended to push sailboats. They tend to have longer shaft lengths (20 or 25-inch) in addition to the standard 15-inch shaft. Such a 4-HP engine might be enough to get you home but has no reserve power.
I think 6 to 8-HP would be a good target to satisfy your criteria. I don't own an outboard in this range but there are many. A close friend had an 8-HP Honda on his 23-foot sailboat; it was a wonderful engine. The sailboat hull is much more hydrodynamically sleek than your square transom hull but it would push the sailboat in all conditions of wind and waves on San Francisco Bay, and full power was never needed. It is a relatively heavy engine though at close to 100-lbs.
Final miscellaneous thoughts: being as how this is a backup engine, I would recommend a two-stroke engine due to its light weight, ease of maintenance, and ability to be stored in any position without losing crankcase oil. If you were going to troll with it and use it more extensively, I would then recommend a four-stroke for its clean smelling exhaust. If you do go with a two stroke, you will need an auxiliary gas tank because the fuel will likely have to be pre-mixed with oil. Running a four stroke main engine is no [problem]. I now run a Honda 135. If you carry extra two-stroke oil, you can mix it aboard if extra fuel is needed. All you have to do is make sure you have a good, safe way of moving unmixed fuel from your four-stroke tank to the auxiliary two-stroke tank if you need more than the auxiliary tank carries to get you home.
I, too, have been let down by a main engine failure. While crossing Green Bay, Wisconsin from Marinette to Sturgeon Bay, the head gasket failed on my 1985 Evinrude 150 causing the engine to overheat. The 9.9 brought us safely in from the middle of Green Bay.