I think it could - extend beyond its unloaded length and, if the spring is not attached to the ramp, slide up the ramp from its original position.
Exactly what happens will depend on the details; the mass of the spring, friction between the spring and the ramp and between the block and the ramp.
Simple questions (or should I say, questions based on a simple model) treat a spring as an ideal store of energy with a well-defined, linear force-extension relation. Once you start modelling taking account of mass and losses, it gets mathematically more difficult.
If the spring has no mass, hence no momentum, it simply returns to its original unloaded length and the block loses contact again at that point. If it has mass then it is obviously moving at that point, so will continue to stretch (the parts of the spring are moving at different speeds) and will also move bodily past that point until gravity stops it.
My intuition is that the block is then at its fastest, as the spring is now slowing down and using its KE to stretch itself. In which case the block may separate at exactly the same point. If there's enough friction, the block may not separate at all - like a critically or over damped oscillation of a spring-mass system.
But I haven't done any maths on it to check any of that.