Vending machine - help needed

As long as you have no delays in the loop, so it's running thousands of times a second, you can simply poll the pin, when you find the pulse you add to your cents, record you see the pulse, and when the pulse is finished you clear that flag again (otherwise a short 1 ms pulse will be counted again and again and again, and your coin pulses may very well be much longer than that).

#define coinPin 2

bool havePulse = false;
int cents = 0;
int oldCents = 0;
void setup() {
  pinMode(coinPin, INPUT);
}

void loop() {
  if (digitalRead(coinPin) == LOW && havePulse == false) { // Pulse coming in.
    havePulse = true; // Record that we're reading this pulse - don't want to read it multiple times.
    cents += 10;
  }
  if (digitalRead(coinPin) == HIGH && havePulse == true) { // End of pulse.
    havePulse = false; // Clear the flag, we're ready for the next.
  }
  if (oldCents != cents) { // The value of cents has changed.
    Serial.print("Coin inserted! Current cents value: ");
    Serial.println(cents);
    oldCents = cents; // Record the new value.
  }
  // Do whatever other stuff you have to do.
}