No, that's fine - you sometimes can't see the end but it's always true that the more you can quote the better, if only so that we can be sure of which line is causing the problem. ALWAYS quote as much of an error message as you can. In this case it's given me enough of a clue. There's an extra getpos in there, which is the sort of thing that happens to me ALL the time. Try
target1 setPos [(getpos target1 select 0) + _rand1A, (getpos target1 select 1) + _rand1B, 0]
and similarly for target2: both have the error but the target2 one occurs last, which is why it appears as the error message.