First of all, you're absolutely right, the not-finishing penalty exists and is the most severe thing to avoid. Getting the last few questions wrong is far better than leaving one blank. Since it takes at least 5 seconds to randomly guess -- that is, click an answer, click "answer," and then click "confirm," if at any point you're down to 30 seconds with a few questions left, just click randomly until you're done, or else you will experience the penalty for not finishing.
Before you reach this point, however, consider this circumstance: you have 10 minutes left and 10 questions (let's assume this is either math, or Verbal and you've done all 4 RC passages so you know it's just CR/RC left). The mistake is to try to rush and spend 1 minute per question. The problem with this is that you'll get them mostly wrong, because that's not enough time (except for some SCs). Instead, you need to pace yourself and do the ones you can do. Ideally, if you alternate between right and wrong answer (right, then wrong, then right, then wrong, etc.), you'll maintain roughly the same difficulty level, and your score won't suffer as it will from either not finishing or from a string of wrong answers at the end due to running out of time.
Practice two skills: 1) "triage" on a question within the first 5 seconds -- that is, decide if this is a question you can do fast, a question you can do but it'll take a while, or a question you're likely to get wrong no matter what. If you can do this in 5-10 seconds (you'll never be 100% accurate, but you can get a good idea quickly), you'll be able to make a more informed decision about whether to attempt a question or, if you're way behind on time and near the end of the test, to guess and move on. 2) guessing strategies that take 30 seconds. If you can eliminate a few choices within 30 seconds, that's a much better way to catch up on time than rushing through your normal approach, and you can use this at the end of the test.
Theoretically, here could be your thought process with 10 questions/10 minutes (let's say on math):
#28: This looks easy enough, I'll do it (8.5 minutes left)
#29: Just used time. Guessing strategy and move on (8 minutes left)
#30: I'll try to do it, I think I can, but it's not easy (5.5 minutes left)
#31: No time, Guessing strategy and move on (5 minutes left)
#32: No time, looks hard, guessing strategy and move on (4.5 minutes left)
#33: Okay, let's try this one. it looks doable (3 minutes left)
#34: No time. Guessing strategy, move on (2.5 minutes left)
#35: It looks pretty hard. Guessing strategy, save my energy, move on (2 minutes left)
#36: I saved time and now I can use it -- this is a topic I know well! (30 seconds left)
#37: Guessing strategy, click an answer, done.
If you've triaged correctly, you'll get all the questions you attempted right, and even guess a couple of the other ones right, and at the very least maintain your score that you had at #27.
Try it out on your next practice CAT, if again you run short on time at the end, and see how it goes!