I had this problem with the bricktext event, I needed the StaticShape to always be a little bit above the top of the brick
Here's what I set for position inside the 'new StaticShape...' :
position = vectorAdd(%this.getPosition(),"0 0" SPC %this.getDatablock().brickSizeZ/9 + "0.166");
Maybe that, minus the '+ "0.166"' with %this being the brick your building on top of?