What you saw was DL9902, a repositioning flight from LGA to JFK. Departed LGA's Marine Air Terminal (DL Shuttle) Gate 2 at 1530 LCL time, arrived JFK's Gate 8 at 1630 LCL time.
Routing was off of 13 at LGA, northeast over Glen Cove, LI, then circle back to RWY22L at JFK. Should have been followed by a DL752, UAL 752, Virgin 744, some sort of business jet, then a American Eagle ERJ. Interesting as until then most if not all domestics were arriving on 13L at JFK (Canarsie Approach), even those from the West Coast, and all International Flights on 22L.
Don't know how long you stayed out at JFK, but the flight left JFK's RWY 13R at 1730 LCL time for BOS as DL9662 and arrived BOS at 1828 LCL time.
I'm guessing it was a charter of some sort or added to the existing flights to accomodate existing oversold flights.
Flight 5804, scheduled to leave JFK at 1715 LCL time, departed on-time.
I can't get load factors, but it's possible DL 5333 (scheduled to and did depart at 1515 LCL time) was oversold, along with DL5804 (1715 departure) and 5354 (the last JFK-BOS flight that leaves at 1910 LCL time) so instead of having to charter busses for those stranded pax on the aforementioned JFK-BOS flights over to LGA, they put those who didn't get on 5333 and 5804 on a ferried 733 from LGA and flew it up to BOS (just as they would in the same situation from LGA). I dunno what SOP is in cases like these.
Then again, could have just been a charter, but it seems unlikely that they would simply ferry over a 733 from LGA for a charter flight to BOS (why not just charter a LGA-BOS flight instead of leaving from JFK?)
Anyway, I'm sure someone with more access can get you better info.