If excess electricity / heat is produced, how can this be integrated into the GHG calculation?

Excess electricity as separate formula element does no longer exist under the REDII. So no direct subtraction from the overall emissions is possible. If excessive heat or electricity is produced and sold externally it should be handled as co-product. Allocation of GHG emissions is possible via the allocation formula described in the System Document 205.

ISCC EU 205 – Greenhouse Gas Emissions (v4.0, 01 July 2021)

The purpose of the document “Greenhouse Gas Emissions” is to explain the options for stating greenhouse gas (GHG) emission values along the supply chain and to provide the methodology, rules and guidelines for calculating and verifying GHG emissions and emission reductions.