What wing spacing is best for a tandem wing configuration?
A tandem wing is never the most efficient planform, but makes for a compact airplane. A case in point is the French design Pou du ciel ("sky louse") which was a very popular homebuilt in the 1930s. The closely coupled wings and the short wing span made it one of the smallest man-carrying designs, but since the rear wing could act like a slotted flap, producing nonlinear lift increases, the aircraft needed careful handling.

Pitch control was achieved by changing the incidence of the forward wing, and a trailing edge down movement normally created a pitch-up moment. Once the gap between the forward wing's trailing edge and the rear wing became too small, the rear wing would show a nonlinear lift increase and add a nose-down movement which became stronger when the pilot pulled the stick further aft. In this condition the aircraft would dive into the ground unless the pilot counter-intuitively moved the stick forward again.



Mignet HM 14 Pou du Ciel (picture source). The initial type flew with a motorcycle engine of 17 HP.

Your idea of moving the wings apart is sound. However, in order to make the plane statically stable, the rear wing needs to produce less lift per area relative to the forward wing, making it less efficient. If you now run an optimizer which varies wing area and minimizes overall drag, you will invariably end up with a conventional design in which the rear wing has 15% - 20% of the area of the main wing.

What is the optimum distance between the wings? This depends entirely on your preferences. You need to know that stability increases linearly with wing-tail distance while pitch damping increases with the square of it. If you want an agile aircraft, keep both close together. If you want to reduce the tail surface and don't intend to fly aerobatics, move both apart. The key figure for stability is the tail volume, which is the product of tail surface area and the distance between wing and tail. Look at airplanes you think are worth emulating and try to match the tail volume of your design to theirs. But don't use a magic number.

In order to minimize engine power, reduce speed. The power need of an aircraft scales with the third power of speed, and many designs of the 1920s successfully used motorcycle engines. A high aspect ratio and a low wing loading, like in a glider, will help to get airborne with just 25 HP. Successful designs with such small engines were the Daimler L 20 or the Messerschmitt M 17.



Messerschmitt M 17 (picture source)