Does adding more engines to commercial aircraft increase safety?
In the modern day and age, it is very difficult to put a numerical value to this type of question, simply because the chance of something happening is so incredibly remote. This is not a clear-cut equation and is dependant on several factors.

A few thoughts:

The impact of loosing one engine will be less significant on a four-engined aircraft than a two-engined aircraft. You only loose 25% of thrust as compared to 50%. However, two engined jets are built with greater safety margin and are able to handle an engine failure at any phase in the flight. Four engined jets are certified to be able to fly on two engines on one side of the wing.

In theory, you are twice as likely to suffer an engine failure with four engines, since you have twice as many engines. While the lost thrust would be less significant, very rarely damage can propagate to cause damage to other parts (See QF32 and ELY1862). In general, it is easier, cheaper and faster to maintain two engines than four. Should a complete engine swap be necessary for instance, you only need to do it twice instead of four times. Every extra step is an step where something could theoretically could go wrong.

The GE90 (Boeing 777) is certified to handle 'large' birds (4kg) as compared to the CFM56 (Airbus A340) only being able to handle 'medium' birds. Hence, the Boeing 777 engines are likely to be a bit more robust.

From a human perspective, pilot workload will be lower with two engines rather than four. Should something happen in a time-critical emergency, there will be more systems you need to keep an overview of. See CAL006.

Furthermore, not every engine-related incident is spared simply cause you have four engines. BA Flight 9 lost all four engines due to volcanic ash. On BA Flight 38, the engines failed in unison due to ice in the heat exchanger on the engines that were operating in identical conditions.

Despite ETOPS being around for several decades and applying to thousands of aircraft I have not heard about a single accident involving commercial jets operating in that domain.