Would be easier to do it based on character count, and I assume you mean threads where the first post is less than 500 words?
It would be something like:
Code:
SELECT thread.thread_id, thread.title, post.message
FROM xf_thread AS thread
INNER JOIN xf_post AS post ON
(thread.first_post_id = post.post_id)
WHERE CHAR_LENGTH(post.message) < 2500