I would start with checking for spark or fuel when it doesn't start. I'm guessing but It sounds like you may be loosing spark. Possibly a crank sensor? Really common for them to fail when they get hot and work when they cool down. Just a thought.
Start with the basics. Whats missing, fuel or spark, and go from there.