Here is what Cambridge says on if with will/would (as 'd is clearly the verb contraction of would):
Will and would can be used in
conditional clauses, either with the meaning of ‘being willing to do
something’, or to refer to later results:
If Clare will meet us at the airport, it will save us a lot of time.
(if Clare is willing to meet us)
If you would all stop shouting, I will try and explain the situation!
If you look up the meanings of would, you'll find that it can also
express willingness or consent (OxfordL)
Cambridge also points out that
We use would to talk about willingness in past time situations.
So your sentence could be read as
He said he'd come back every May, just to help me if I would be willing to paint.