What do you think of using the serial port for debugging data?
Use print statements to announce where you are. Keep the strings short and the link fast and you shouldn't have a problem with overfilling the buffer.
If you don't like that one.
Set up a global variable and set it to different values at different places in your code.
Attach an interrupt handler to pin 3.
When it hangs. Press the interrupt button and output the value of the global variable some how. Maybe blink the value out on pin 13.
This might at least tell you where it is hanging, maybe then you can work on why.