The two solutions with square edges along the triangle sides cut the triangle into either two or three smaller 3-4-5 triangles. The case where only three points of the square touch the sides of the triangle cuts it into two triangles different from the 3-4-5 and one four sided shape.
It might be interesting to consider a square inscribed in a 3-4-5 triangle. If the square must touch all three sides, what is the largest, the smallest possible?
Apparently, this construction, the original square with semi-diagonals as @DaveC426913 drew in post #18, goes back thousands of years and has numerous properties of interest. There is a Wooden book called The Diagram all about it. This construction is also called the Helicon. Wooden books...
Here is a simple drawing of the regular octagon within the square. If the square has corners at (±1,±1), the outside points are root(2) from the center. The angle of the lines to the sides is 22.5 degrees.
I was looking at how to make a regular octagon in the spirit of the OP but it’s difficult to construct the ratio you mentioned without invoking a compass or just measuring which I’m trying to avoid.