First off, you must throw the projectile upward with null horizontal speed. Remember that Mario doesn't need to have zero speed for this and it's useful to try pressing left+up or right+up.
Every sprite has 4 points of interaction, like draw in the pictures. You must observe the head and the lateral point that touches the block. Drawing the block boundary is also useful.
The solid blocks only push sprites outside every other frame. That means that in odd frames they will push to the right (or left) and in even frames they will push to the opposite side. By the time the projectile gets inside the block, the direction must push the projectile outside and remove the head from its boundary. The lateral push is always 4 pixels wide.
Let's see each step of a duplication away:
|click to increase the pictures|
The sprite starts with vertical speed -112 and it increases +3 each frame.
334.0 - 97 = 334.0 - (6*16 + 1) = 334.0 - 6.0 - 0.1 = 328.0 - 0.1 = 327.F
Let's see what happens in the middle of the frame.
The sprite goes up and the lateral points touch the boundary:
1) The setup consists in positioning the projectile in a good horizontal position, good vertical position and good vertical subpixel. The closer to the block, the wider is the number of possible initial positions. You should be able to predict the oscillation of the block too and always check if the sprite is not moving to the left/right.
2) the majority of handheld sprites have the same offsets and dimensions. However, it might be the case that the vertical distance between head and laterals is not 7 pixels. In this case, the minimal speed required is not -97.
3) the emulator used was lsnes. The Lua script used to display the helpful info is my smw-tas.