you have to mirror the colliding direction along the normal. that's simple and works in every dimension, given you're in hilbert space.
n normal
c colliding vector
b bouncing vector
b = |<c,n>|*n + (c+|<c,n>|*n) = 2*|<c,n>|*n + c
to implement it you only need to know that |<,>| is abs(vec_dot(...)) here and the normal points away from the surface and has length 1 (use vec_normalize).
sample:
your screen has coordinates x growing from left to right, y from top to bottom. your ball has speed (5,3), the normal of your right screen side is (-1,0). then b is
b = 2*|<(5,3),(-1,0)>|*(-1,0) + (5,3) = 2*|5*(-1)+3*0|*(-1,0) + (5,3) = 10*(-1,0) + (5,3) = (-5,3)
as expected.
another example. your surface normal is angular in the top left, so the normal is something like (3,4)/5 (this is normalized to 1!). your ball has speed (-3,-10), so b is
b = 2*|<(3,4)/5,(-3,-10)>|*(3,4)/5 + (-3,-10) = 2*|(-9/5-40/5)|*(3,4)/5 + (-3,-10) = (8.76,5.68)
and again the length is preserved, as expected.
i hope you get it done now

greetings, joey.
edit: if you want to use your own variables, not vectors, know that
|<a,b>| = abs(ax*bx + ay*by)
as i used it in the examples. normalizing surface vectors can also be done by hand, just use
n_normalized = n / |<n,n>| = n / ||n||