hmmm, not sure if that's enough code to show you any code. However, you can achieve what you want by two ways.
The first is what you were thinking of originally.
The link the user clicks on contains the anchor. We'll call this the pre-click method. In order to generate the correct link, you'll need to calculate the pagination in advance. Usually pagination calculation is done when you are ready to create the previous/next buttons. In this case, we know we don't want to see the first post in the thread, we want to see the most recent one. I'm going to make an assumption that pagination is done by calculating the offset from the beginning of the found records. So, when we create our link with the anchor tag, we want to first calculate how many posts the thread contains. Then we calculate which number our desired post is. Once we know what number our post is within the result set, we can use the number of posts per page to figure out the correct offset.
$offset = ($number_desired_post % $posts_per_page) * $posts_per_page.
EDIT: oh yeah, the % is the mod operator.
So like 17 % 5 = 3 because 3 is the most number of times 5 can go into 17 wihtout having any remainder. (kind of like division without remainders). so then, if the post was the 17th one in the thread, and we know we only allow 5 posts per page, then our post will be on the 3rd page. but most likely, you don't tell the pagination script you want the 3rd page, but you want to start the page at a certain LIMIT offset. so 3 * 5 is post offset that starts off the 3rd page. The anchor tag will move us down to the 3rd post on the 3rd page.
Then hand the offset to your pagination script, and it should go to the correct page.
The second method is post-click. We can add to our link something like action=go_to_recent_post. Then, when we are in the page, we still basically have to do the same thing.
THe select query to get the number of our desired post is actually asking for the number of posts before the date of the ID of our desired post (you alreayd know which post ID you want, right? TID?). So it's something like SELECT COUNT() FROM threads WHERE DATE < $date of our post.
something like that.
enjoy