Problem with "add comment to dependant tickets" scrip

RT-3.6.0

I have a very basic scrip (see below, copied from the Wiki) which adds a
comment from one ticket to the tickets it is depended on by.

The queue with the dependant tickets uses out of the box scrips and
notifies owners when a comment is added.

If I trigger the below scrip “On Resolve” the owner of the dependant
ticket is sent one email with “Reviewer’s notes: some text here” in the
body.
Note, I am not resolving the dependant ticket, just adding a comment to it.

However if I trigger the scrip “On Comment” the owner of the dependant
ticket is sent two emails. One with "Reviewer’s notes: some text here"
in the body, and the other with “Reviewer’s notes:” in the body, missing
the comment.

The strange thing is the dependant ticket history only contains a log
for one email being sent, the one containing the comment.

I apologise in advance for my lack of perl-sense.

Taan

SCRIP:

my $note;
my $t = $self->TicketObj->Transactions;
while (my $o = $t->Next) {
$note = $o->Content() if
$o->Type eq ‘Comment’;
}

foreach my $obj ($self->TicketObj->AllDependedOnBy( Type => ‘ticket’ )) {
$obj->Comment(
Content => $self->loc( “Reviewer’s notes: [_1]”, $note
),
);
}
return 1;

I have a Depended-On ticket which has the following scrip applied to its
queue.
My scrip condition is "On Comment"
My template is "Global Template:blank"
My scrip action is “user defined” with Custom action preparation code:

my $note;
my $t = $self->TicketObj->Transactions;
while (my $o = $t->Next) {
$note = $o->Content() if
$o->Type eq ‘Comment’;
}

foreach my $obj ($self->TicketObj->AllDependedOnBy( Type => ‘ticket’ )) {
$obj->Comment(
Content => $self->loc( “Reviewer’s notes: [_1]”, $note
),
);
}
return 1;

I am not sure if this is a bug or just an anomaly, but as soon as I
click on the Comment link in the Depeneded-On ticket an email is sent by
the Dependent ticket, before “Update Ticket” has even been clicked. ie
no Comment has yet been added to the Depended-On ticket let alone the
Dependant ticket.

There is no history of a comment being added to the Dependant ticket, or
of an email being sent.

There are no scrips apart from the one above in the queue for the
Depended-On ticket. And I have disabled all scrips except for On Comment
in the Dependant ticket queue.

Is this weird or am I just missing something blatantly obvious?

Taan