No don't replace anything yet, well one thing.
ignore test codes like 77, when you read codes computer can go into a test mode and it expects person running the test to do certain things in a certain order.
77 System did not receive "goose" test
51 Engine Coolant Temperature (ECT) sensor signal is/was too high
Computer has it's own engine temperature sensor, it uses this to run engine in "Choke mode" when it is cold, i.e. high idle and richer fuel mix.
On 2.3l the ECT sensor should be on the drivers side of the engine towards the front under the intake, it will have 2 wires.
They are $6-$8 just replace it unless wires are broken.
33 EGR did not open/ respond during test or if memory code, did not open intermittently
Since you got the 77 code this could also be a goofed test, unless you know it was a Memory code?
EGR valve not opening would cause engine to ping/knock when accelerating or when going up hill.
If you want to test EGR valve get a vacuum hose.
remove EGR valve vacuum hose, it should not have vacuum pressure when idling
Put your vacuum hose on the EGR valve and suck on the other end
If EGR valve is opening the idle should start to stumble and if you hold it open long enough engine may stall, release vacuum pressure and idle should return to normal.
EGR valve should open when engine is under load, so it wouldn't rob any power, and if it doesn't open then engine will ping/knock so you would know it.
If the loss of power was only after it warmed up then changing the ECT sensor might help, but I think there could be another issue.
I would do a Vacuum test on the engine, vacuum gauges are $25 and can tell you alot.
Good read here: Technical Articles: Engine testing with a Vacuum Gauge - at Greg's Engine & Machine
Just wondering if sitting may have caused Cat or muffler to get rusted out and might be preventing good flow out the tail pipe, this can come and go as pieces flip around.