Ugh, I always do this. Solved my own problem fairly shortly after posting. But thanks for your reply Pazil!

Apparently my problem was in try to calculate the x and y positions using the same functions. I'm guessing I only have to deal with the z-axis once, and my old code dealt with it twice, causing the errors.

So my new code has separate function for finding the x and y positions. Now, I have have no idea how flawed this attempt may or may not be, but here's the code form my latest version for those interested:

PHP Code:
var magic 180/Math.PI;
function 
getA(x1,y1,z1,x2,y2,z2) {
    var 
Math.sqrt((x2-x1)*(x2-x1)+(z2-z1)*(z2-z1));
    var 
yd y2-y1;
    var 
Math.atan2(yd,d)*magic;
    return 
r;
}

function 
getAX(x1,z1,x2,z2) {
    var 
zd z2-z1;
    var 
xd x2-x1;
    var 
Math.atan2(xd,zd)*magic;
    return 
r;
}

p0 = [-50,-50,-50];
p1 = [-50,50,-50];
p2 = [-50,-50,50];
p3 = [-50,50,50];
p4 = [50,-50,-50];
p5 = [50,50,-50];
p6 = [50,-50,50];
p7 = [50,50,50];
p8 = [0,0,0];

var 
50;
var 
0;
var 
= -50;

var 
xa 0;
var 
ya 0;

for (var 
n=0_root["p"+n]; n++) {
    
_root["p"+n][3] = "0x"+random(10)+random(10)+random(10)+random(10)+random(10)+random(10);
}

onEnterFrame = function() {
    
removeMovieClip(s);
    
createEmptyMovieClip("s",1);
    
    
_ymouse-180;
    
_xmouse-180;
    
    if (
Key.isDown(Key.UP)) y++;
    if (
Key.isDown(Key.DOWN)) y--;
    if (
Key.isDown(Key.LEFT)) x++;
    if (
Key.isDown(Key.RIGHT)) x--;
    
    if (
xa >= 360xa 0;
    else if (
xa 0xa 359;
    for (var 
n=0_root["p"+n]; n++) {
        
_root["p"+n];
        
s.attachMovie("a","a"+n,n);
        
s["a"+n];
        
        var 
= new Color(o);
        
c.setRGB(p[3]);
        
        
x2 getAX(x,z,p[0],p[2])+180;
        
y2 getA(x,y,z,p[0],p[1],p[2])+180;
        
        
o._x x2;
        
o._y y2;
    }