Hi vietwave,
For point #1, I am assuming when you mention go to the big loop you are referring to the outer lower loop. From the code it appears that due to the local variable you are using, the only way you would get out of the inner loop is to press the stop button. This is why it appears not to be exiting. Also, for the tick counts, you mentioned that it does not count anything. You should remove the shift registers, this will allow the count value to increment and display a value once the program exits the loop. Also, the reason why when you attach the LED to the Case Structure it appears not to work is because when you get into the case structure, you go into a while loop which essentially goes into an infinite loop (until you press the stop button). Please let me know if you have any questions about this. Would you happen to have a board with two counters? This would be a more effective method to measure a pulse width. If not please let me know if you have any questions on the suggestions I have proposed to your current code.
Best regards,
Steven