Question 1: Do damage modifiers go off of the original stat or a previous boost?
Answer: It goes off of the base stat. If I use Swords Dance on my Mega Heracross, then Swords Dance a second time, the second move will boost based on Hera's base Attack, not the Attack stat from the previous boost.
Question 2: Do stat boosts last until the end of the match, or until I attack?
Answer: Neither. A stat boost lasts until you switch out (or it's nullified by something like Snarl or Intimidate). If I have my Heracross, who's at +2, he will stay at +2 until he switches out.