Her overdoing it saved her in this case. The 'worst' case scenario would have been that she simply wrote her name, no hearts or ensuing embarrassment, without thinking about the consequences in her giddiness.
At which point she was exactly one school day from either getting asked why she'd put her family name down as his or directly called out using his name.