@tim-0 There are Print_end.g and Print_start.g, which you could put the fan code in, but as I understand it, you will still need to edit the slicer start gcode to call the files. This will make it slightly easier to change between slicers.

I've not tried using meta commands, but it looks interesting.