You can turn unused heater outputs into general purpose output pins with M307, then use M42 to control them. That might be easier. Or if you only want the solenoid on during extruding moves, use M571.
Remember to connect a flyback diode in parallel with the solenoid.
Thanks for the reply! It sounds like M571 is the most direct route, so I think I'll give that a spin first. To make the extruders on would I include something in the firmware like:
M571 E0 F0
I'm not sure how the PWM should behave or if I can exclude the F variable entirely in this case. Also, thanks for the heads up on the flyback diode. I totally overlooked that and will definitely be including that going forward.