advice needed for arduino as diesel injection brain...

int posPin = A1;          // the input pin for position sensor
int posValue = 0;         // variable to store the value from the sensor
int injectorpin1 = 13;        // the pin for the injector solenoid1

Consistency is good. If you were consistent, the 3rd variable would be named injectorPin1, which would be much easier to read, in my opinion.

long previousMillis = 0;     // will store last time injection time was updated

Time variables are unsigned long. You don't normally need to accommodate time running backwards. At least not in our universe.

  if(posPin == 0) // of camshaft position is 0 degrees then fire cylinder 1
  if(posPin == 256) // of camshaft position is 90 degrees then fire cylinder 3
  if(posPin == 512) // of camshaft position is 180 degrees then fire cylinder 4
  if(posPin == 768) // of camshaft position is 270 degrees then fire cylinder 2

I don't know what kind of analog device you are reading, but depending on exact values from an ADC with a resolution of +/- 1 is not a good idea. Your injectors are going to not fire when they are supposed to, a lot.

When to fire the injector. with respect to cam position, is typically a function of load, engine RPM, and a host of other sensor readings. I fear that you are oversimplifying a very complex process.

I don't understand.
In bash to would mean "if $currentTime minus $previousTime is larger then Interval (throttle position) stop injecting"???

It means, without the $, exactly the same thing in C.