I'm not sure what you mean by "code a timeout" bit. Are you referring to the "timeout bit" or the "CodeBit"? When you say you have the heart module, I take it to mean you have the pulse bit.
Below are some links that you might find helpful. Please feel free to follow up with more information, questions, and a picture of your circuit.
1) Tips & Tricks for timeout Bit: https://education.littlebits.com/cwists/preview/1786x
2) Tips & Tricks for Pulse Bit: https://education.littlebits.com/cwists/preview/1819x
3) Tips & Tricks for CodeBit : https://education.littlebits.com/cwists/preview/810x
4) More about your CodeBit: https://education.littlebits.com/cwists/preview/816x