It looks like you had a little typo where your last vertex is the same as your first, you probably meant Vector3(-0.5, 0, 0.5)
for that one. I modified your code to the following and this seems to draw a quad as intended:
var a:PoolIntArray = [0, 1, 3, 1, 2, 3]
vertices.append(Vector3(0.5, 0.0, 0.5))
vertices.append(Vector3(0.5, 0.0, -0.5))
vertices.append(Vector3(-0.5, 0.0, -0.5))
vertices.append(Vector3(-0.5, 0.0, 0.5))
var st := SurfaceTool.new()
st.begin(Mesh.PRIMITIVE_TRIANGLES)
for index in a:
st.add_index(index)
for vertex in vertices:
st.add_vertex(vertex)
self.mesh = st.commit()