Go 12v.
Most electromagnetic circuits start working at 70-80% of their nominal voltage.
The box you've found is perfect to house a 9v pp3 battery and should run fine.
If you try to get to 24v you will need 2x pp3 to get to 18v and a lot more wiring.
The YouTube videos use ikea batteries and give upwards of 1hr magnetised time from memory
Most electromagnetic circuits start working at 70-80% of their nominal voltage.
The box you've found is perfect to house a 9v pp3 battery and should run fine.
If you try to get to 24v you will need 2x pp3 to get to 18v and a lot more wiring.
The YouTube videos use ikea batteries and give upwards of 1hr magnetised time from memory