For wall collisions you shouldn't mess with velocity unless you handle it better than you are. I used Game Maker a lot a long time ago, so I'm very familiar with it. Here's some old code I have:
Code:
// Approximates object as a circle. Set 'radius' to half the size of object squared.
var px, py, dx, dy, t, l;
dx = x2-x1;
dy = y2-y1;
if (dx == 0 && dy == 0)
{
px = x1;
py = y1;
}
else
{
t = min(max(((x-x1)*dx + (y-y1)*dy) / (dx*dx + dy*dy), 0), 1);
px = x1 + dx*t;
py = y1 + dy*t;
}
dx = px - x;
dy = py - y;
l = dx*dx + dy*dy;
if (l < radius)
{
t = sqrt(radius / l);
x = px - dx*t;
y = py - dy*t;
}