To expand on what Xavier said, and copied from a previous comment of mine...
You can use TOUCH OUT STTM,TX,TY
STTM is how long the screen has been touched. It will be 0 if there's no touch. The time it returns is in hundredths of a second.
TX and TY are the coordinates of the point that is being touched, or the last touched if the user is no longer touching the screen.