Yes you are correct. You can do one of two things to make it applicable only on certain threads. The easy way:
Set a whole board where you can only make one reply per thread and HARD CODE the board ID into the code. IE - if board number 3 should only allow one reply per topic use:
$result = mysql_query("SELECT
m.ID_MSG FROM {$db_prefix}messages As m
LEFT JOIN {$db_prefix}topics AS t ON (t.ID_TOPIC =
m.ID_TOPIC) WHERE
m.ID_TOPIC = $threadid AND
m.ID_MEMBER=$ID_MEMBER AND
t.ID_BOARD = 3 LIMIT 1") or database_error(__FILE__, __LINE__ );
(I think the join is necessary unless messages contains ID_BOARD (Which I don't think it does).
The harder but better way is probably to add a column to the topics table, for arguments sake called CAN_MASS_REPLY - default 1.
Then just use:
$result = mysql_query("SELECT
m.ID_MSG FROM {$db_prefix}messages As m
LEFT JOIN {$db_prefix}topics AS t ON (t.ID_TOPIC =
m.ID_TOPIC) WHERE
m.ID_TOPIC = $threadid AND
m.ID_MEMBER=$ID_MEMBER AND t.CAN_MASS_REPLY != 1 LIMIT 1") or database_error(__FILE__, __LINE__ );
Then of course you have to be able to set the value for a thread. You can either do this using phpmyadmin or make an edit box for the topic starter, obviously all this takes time

Another way to do it is to make it so all topics which allow one reply have the subject line starting [SINGLE] (or similar). Then do a query to get the first reply of the topic, get the subject and then strpos [SINGLE] in the subject, and if it's there check if the user has replied and if so stop them doing it again.
Lots of possibilities ranging in usefulness and easiness
