Try removing or commenting out the following line from your ADDHour routine within the "if hourmode = 0" block (24 hour mode)
if BCDResult_temp > 12 then RTCHour.5 = 1