@southpaw - the 'limit = 50' line should have been put higher up since it's not really in the modulo loop - should have been with the 6X vector list. I think I originally had the lines as if abs(...) > 50, but sometimes it's better to have a named value when troubleshooting (also quicker to change limit = 50 than to change 3 lines).
So the speed of animation just consists of <find new vector and add it to position> every 2 frames. If the new vector takes the sphere outside the limit, it stays in the 'while loop' until a suitable vector is chosen.
'While loops' can be very problematic in C4D. If your code is bad and the program gets stuck in the 'while loop', you can't seem to halt or escape - you have to close C4D and thus lose any unsaved work. I usually develop code using Pycharm - a free python IDE. In Pycharm, it's easy to halt an infinite loop. You can write and test a function in Pycharm, then paste it into C4D.
Although C4D python is different to regular python in that the code is repeated every frame (not just once), you can simulate this in Pycharm with a 'for loop' to some extent. Bear in mind that if you install Python 3.7 for use with Pycharm, there's some differences compared to C4D's v2.7 - mainly print syntax and integer division.
I'm with you about MAXON Python SDK - it's like trying to understand Russian without a dictionary. I just look at other peoples code and steal bits that seem useful. The plugin cafe can be a place for this. Google search for python usually takes you to stack overflow. I've learned tons from that site, even though some of the replies seem to be written entirely in reserved words - a skill in itself.
One rather obscure way I learn about programming in general is by randomly clicking through XKCD comics - many of the jokes are about coding eg this one . There's an Explain XKCD site where you can enter the comic number for in-depth explanations - eg code quality comic discussion.
If you like, I could zip up half a dozen of my python scenes for you to look at. Not all are commented, but you might find bits you can steal.
edit - re: syntax - are you aware that you can just drag stuff into python from the attrib manager eg camera focal length here
def main():
cam = doc.SearchObject('Camera')
cam[c4d.CAMERA_FOCUS] = 18