WD40 will evaporate eventually so it's not a good for this, ACF50 would be better.
I just use clean engine oil, wipe it over or use a brush to coat it and then cover over with something. I've had a 998 block on my bench for a couple of years (I'll get around to it...!) and it's rust free.
Yeah this is good advice, my 2 cents is this:
I had an engine outside all year in all weathers with the head off , bores exposed etc, so what I did was clean it all down with gunk (optional, i was just celaning it because it needed it) Once its cleaned I dried it with compresssed air thorough ly to get all moisture out.
Then I liberally sprayed ACF-50 over it and brushed it onto all the surfaces of the engine gearbox, then Pushed some workshop towels into the bores and filled the bores with as much engine oil as I could, then I smeared engine oil all over the block deck and got some plastic sheeting and stuck the sheeting to it , this sort of holds the oil to the bare metal surface really good. Then I draped a towel over the whole engine and then ontop of that a big plastic tub I had lying around to keep out any rain.
That engine was outside in rain, hail snow everything and after 2 years I uncovered it and it was still oily and hadn't suffered any corrosion whatsoever