What can cause the SMC to repeatedly need to be reset? I currently have a problem with my MacBook Pro where the SMC keeps getting screwed up and needing to be reset. The result is always that my keyboard and trackpad become useless, and I have to use an external keyboard and trackpad.  

I took it to the Apple Store and they just reset the SMC, which seemed to fix it, but within a few hours it happened again.  I was once or twice able to reset the SMC myself with an external keyboard, but the latest time it happened (always within a short time of the last reset) I could not get the key sequence to work using an external keyboard (and obviously the built-in keyboard is useless!).

This is really aggravating.  Is there anything that could be causing this?
Repeatedly needing to reset the SMC indicates a hardware failure. Apple generally replaces entire components - so you'd get a new logic board / GPU / processor board and then that failing board would get analyzed / repaired as appropriate.

It could be as simple as some sensors that are bad and reporting continuous bad readings that the SMC can't handle. It also could be the SMC itself has issues. Without analyzing the logic signals of that processor - hard to guess. The main idea would to realize that a mail in repair for MacBook run about $300 and take a few days - so when your aggravation exceeds that cost to remedy - you can get it fixed. If you don't feel that computer is worth the $300 - you can consider a new computer once you can't rely on this hardware. Be sure to keep good backups, SMC and logic board failures generally leave the system unbootable so it costs more to recover data after it fails. On T2 Macs, you can’t get data off a failed SMC/T2 module as the decryption keys are exclusively stored there in a Secure Enclave.