can a sketch be re-written as and used function

Hello and Good Day,
I am using the source code of a binary clock by Tasos Sagiotis. The PWM pins are occupied, and can't be used to fade LEDs. I have found the following sketch which uses the digital pins to "pulse" or fade the LEDs. I would like to pass each pin as it is determined by the BC to pulse 2x before staying HIGH. Can this sketch or any sketch be changed to a function ? Thanks for your consideration.

Pulse sketch:

int ledPin = 13; // LED CONNECTED TO DIGITAL PIN 13
int value = LOW; // PREVIOUS VALUE OF THE LED
long cnt = 0; // WILL STORE LAST TIME LED WAS UPDATED
long low = 0; // INTERVAL AT WHICH TO BLINK (MILLISECONDS)
long high = 1000; // INTERVAL AT WHICH TO BLINK (MILLISECONDS)
int op = 3;
long a = 0;
int count;

void setup()
{
pinMode(ledPin, OUTPUT); // SETS THE DIGITAL PIN AS OUTPUT
}

void loop()
{
a += op;
blinkl( a+30, 10 );
if( a > 200 || a < 0 ) op *= -1;
}

void blinkl(long low, long high )
{
int c = 5;
while ( c > 0 ) {
blink( low, high );
c-=1;
}
}

void blink( long low, long high )
{
long period = 4000;
long pt = period * high / (low + high );
int value = LOW;
digitalWrite(ledPin, value);

while( period > 0 ) {
if (period < pt && value == LOW ) {
value = HIGH;
digitalWrite(ledPin, value);
}
period -= 1;
}

}

In this video I show how to re-factor your code to use functions, and fix the approach you are using (your code blocks other code from running). You can put any code you want into a function and it will improve readability and help you avoid writing the same code (and having to maintain it) in several different places. For example, a common mistake I see is writing data to the LED pin without updating the status variable, or the opposite, changing the status variable without writing the pin. If you put both of those things in a function, and always use the function, you can't make that mistake any more. So, functions can be used to improve logical correctness, and help developers avoid brain-farts.

Nice job with the video, you really explained a lot in here, and opened up a whole new set of doors. Well done. Thanks.