The following is based on the source decompiled via 1.9 ModCoderPack.
The current growth stage of the stem is saved as its metadata value. You can view this value via the F3 menu. The image shows a stem partway into its growth, via the
This value increments by random chance via random ticks rather than an internal timer. The following is the random chance condition, provided the light level above the stem is 9 or higher:
rand.nextInt((int)(25.0F / growthChance) + 1) == 0
If a random value generated from 25 divided by the "growth chance", and after being floored has 1 added, is equal to 0, then the crop has the ability to either grow taller or grow a melon/pumpkin, depending on its growth stage.
The value for
growthChance is obtained using the same function that all crops use, being the existence and hydration of surrounding farmland and nearby crops. The wiki details the long list of conditions here.
For example, provided the following arrangement:
growthChance will always be 4.0, which means a random value between 0 and 7 is chosen. If the random value is 0, then the crop is ready to grow.
If its growth stage (metadata value) is 6 or lower, it will increase by 1, visually increasing the height of the stem. Nothing else will happen and no other checks are made.
If the growth stage is 7, then one random location surrounding the stem will be chosen. If that location is air and the block below that is grass, farmland, or dirt, then a new melon/pumkin block will be placed. If those conditions fail, then nothing happens and it must receive another random tick to attempt placing another block.
If the growth stage is 7 while the blockstate
facing is not "up", and it's facing a respective melon/pumpkin block, then a new melon/pumpkin block cannot grow.
As such, the growth timer will not reset by placing a block where a melon/pumking can grow since there is technically not a timer at all. But a badly-timed placement of a block could prevent potential growth should the stem receive a random tick update at that same moment. There would be no way to detect it and no way to prevent it, short of making sure you remove any impeding blocks as soon as possible to reduce the chance of a clash.
From a technical perspective, it is very possible that a melon could successfully grow twice in quick succession (as quick as twice in 2 ticks), but it is not probable.