Because you can only define variables to work on primatives the only way this can be done is to define a very small sphere (or cube) and then move that through the values of x y z that you want. I will give you any shape but it will take massive processing power to do anything complex.

For that sort of manipulation it would be a lot easier to work with straight Gcode than anything else. This is because Gcode naturally joins specific dots where Openscad does not.