Snap to alignment with other vertices (implicit grid)
I'm not completely sure if I understand your question, but this is how I would go about your example.


  Example: Given a usual triangle, say you want to move the bottom right
  vertex to the top of the triangle (only z). You move that corner
  vertex upwards and once it aligns with the top vertex in the z-axis,
  it would snap to that z-value.



select the bottom right vertex of the triangle;
switch snapping mode to 'vertex, closest, move';
press g to move the vertex;
press z to lock the z axis;
hold control to enable snapping while moving;
move the cursor to the top vertex of the triangle.