I haven't looked at your code very close and don't have an answer for you but I will make a suggestion on simplifing the decoding of the time in setting the LED's.
It appears you're displaying time in BCD format.
Using 'ternary' syntax combined with the boolean '&' (bit and) the appropriate LED's states can be decode and set as follows:
// --- minutes ones
digitalWrite( 1, ((munit & 0b00000001) ? HIGH : LOW)); // 1's
digitalWrite( 2, ((munit & 0b00000010) ? HIGH : LOW)); // 2's
digitalWrite( 3, ((munit & 0b00000100) ? HIGH : LOW)); // 4's
digitalWrite( 4, ((munit & 0b00001000) ? HIGH : LOW)); // 8's
// --- minutes tens
digitalWrite( 5, ((minute & 0b00000001) ? HIGH : LOW)); // 1's
digitalWrite( 6, ((minute & 0b00000010) ? HIGH : LOW)); // 2's
digitalWrite( 7, ((minute & 0b00000100) ? HIGH : LOW)); // 4's
// --- hours ones
digitalWrite( 8, ((hunit & 0b00000001) ? HIGH : LOW)); // 1's
digitalWrite( 9, ((hunit & 0b00000010) ? HIGH : LOW)); // 2's
digitalWrite(10, ((hunit & 0b00000100) ? HIGH : LOW)); // 4's
digitalWrite(11, ((hunit & 0b00001000) ? HIGH : LOW)); // 8's
// --- hours tens
digitalWrite(12, ((hour & 0b00000001) ? HIGH : LOW)); // 1's
digitalWrite(13, ((hour & 0b00000010) ? HIGH : LOW)); // 2's
Other suggestions to the code if you don't mind them at this stage of your project.