Yes there is a specific method that gets executed when you load an MC package: The initialize
method!
To be more precise, it gets executed if it the initialize
method is different from the one that already is in the image. MC treats these class initializers specially (just like they are treated specially when you use change sets instead of Monticello).
So in your example, everything is fine. Loading the second version of initialize
will cause it to be executed. (Edit: now that you updated your example so initialize is not itself modified, you need to follow the advice in my next paragraph).
Be careful though: If another package version has the same exact initialize
class method, it will not be executed again. This is because Monticello, when loading a package, only considers the methods that are different from what's in your image, and what the loading version offers. So if you want to force execution of the initialize
method, you at least need to give it a different timestamp.