C1102-Acceleration Switch Circuit Failure, is for the ABS brake system not the engine system.
There is a motion detection device, the "acceleration switch", for the ABS, usually in the frame rail, this allows the ABS to tell the difference from a skidding wheel vs just coming to a stop.
P0171 and 0174 - bank 1 and 2 too lean
This doesn't mean engine is actually running Lean
The computer gets air flow data from MAF sensor, it then uses 14:1 air:fuel ratio to calculate the amount of fuel it needs to add to the air that is coming in.
After this air:fuel mix is burned, the O2 sensors tell the computer if the burn was Lean or Rich and computer adjusts fuel mix to make burn "just right".
Computer uses Fuel Trim numbers of + and -, - means it is adding Less Fuel than calculated, + means it is adding more fuel that calculated.
0 is the calculation based on MAF sensor data.
If computer gets up above +20 for any length of time it will notify driver by setting a code, it is still adding the needed fuel but is letting driver know there is a problem, "things don't add up".
+ numbers would set Lean codes
- numbers would set Rich codes
When both Banks(sides) of the engine report Lean, it eliminates an O2 sensor problem since there is one on each bank, and for both to fail at the same time would be very very long odds.
Vacuum leaks cause Lean codes because ALL the air coming into the engine is not flowing thru the MAF sensor, so computers calculations are based on less air than is actually coming in.
An air leak can also be on the air tube between MAF sensor and intake, ALL the air must pass thru the MAF sensor, or calculations will be off.
Lower intake vacuum leak would be a long shot since that would usually only effect one bank.
Upper intake vacuum leak would effect both banks, as would faulty MAF sensor.
After engine is warmed up you can unplug the IAC Valve, engine RPMs should drop down to 500 or engine may even stall, either is good it means no vacuum leaks.
If idle stays high, 700+, then you have a vacuum leak somewhere.
Computer has a "sanity" check for MAF sensor, it knows how much air a 4.0l engine uses at specific RPMs, 4 liters of air every 2 RPM, it of course varies by throttle position and load, but there is a range that MAF data will stay within, so without a MAF sensor code I would think it is OK, but cleaning MAF is always a good idea.
Fuel Pressure, computer doesn't/can't monitor fuel pressure, on a '99 Ranger fuel pressure should be 60-70psi.
Computer bases its calculations on this fuel pressure, the amount of fuel that will flow when injector opens.
If pressure was lower then when computer opens a fuel injector less fuel would flow in to engine.................so computers calculations would be off, it would have to add more fuel, high + trims, and Lean code
You mentioned the engine can be hard to start, that could be a sign of low fuel pressure.
The computer runs the fuel pump power, when you turn on the key the fuel pump will come on but only for 2 seconds, this 2 seconds adds about 10psi of pressure.
Your fuel system should hold pressure when engine is off for a few months, not minutes, hours, days or weeks.......months.
So 2 seconds is more than enough to prime a sealed system.
To see if you may be losing fuel pressure try this:
Turn key on, count to 3, and turn key off
Repeat this 3 or 4 times, so you are running fuel pump 6 or 8 seconds.
Now try starting and see if it fires right up.