To me attempting to use a timeout to address what likely are electrical/signal problems seems not a good approach. Have you checked signals with an oscilloscope and verified that that's all OK ?
Would you have some more detail at what frequency you are running the I2C bus, wire length, type of...