sed: a "replace unless match" question

Context:
I am using sed in a cronjob to change the dates in a separate sql script every week. Each week the dates must be updated to reflect the Monday and Friday of the previous week. I have solved the problem but in solving it I discovered a major weakness in my knowledge of sed.

Lines to be changed ( SQL excerpt ):

datediff(dd, 'Jan 1, 1970', 'May 25, 2009') and
datediff(dd, 'Jan 1, 1970', 'May 29, 2009')

My current solution:

LAST_MON=$(date -d "-7 day" | awk '{print $2 " " $3 ", " $6}')
LAST_FRI=$(date -d "-3 day" | awk '{print $2 " " $3 ", " $6}')
# The following changes the "Monday"
sed -i "/^datediff.*and$/s/\(1970'\)\(.*\)\(and\)/\1, '$LAST_MON'\) \3/" $SQLTEST
# Now for the Friday
sed -i "/^datediff.*[)]$/s/\(1970',\)\(.*\)/\1 '$LAST_FRI'\)/" $SQLTEST

My question ( 2 parts ):

  1. How would you simplify this or improve this?

  2. Regarding Fridays: How would you express the following in sed?:
    Find all lines starting with "datediff" AND NOT ending with "and"
    THEN
    Replace the 2nd date string with the variable for last friday.

Here's what I've tried ~

sed -n "/datediff/p; /and$/!s/\(1970', \)\(.*\)/\1 '$LAST_FRI'\)/p" $SQLTEST

Keeps saying "Event not found".

Thanks!

Bub

UPDATE: I figured out one possible solution. Maybe not the most elegant ...thoughts? ~

sed -i '/and$/!s/\(^datediff.*1970'\'',\)\(.*\)/\1 '\''$LAST_FRI'\''\)/' $SQLTEST

Note for noobs: Those are side-by-side single quotes NOT double quotes in the example above.