Can you post the code that is stuck in an infinite loop, your description doesnt really tell us. I assume you are using some form of conditional that is not meeting it's exit condition. Basically, whenever you have ANY kind of loop, for, if, while etc... any kind at all, in a program, you really really need to make sure that you have some way in your code for its exit condition to be met, otherwise it wont be able to exit the loop....
to move your ant a certain interval and rotate/move again, you would need to assign a variable to your ant, that will keep track of how far it has moved, and also a variable to keep track of how far it can move in total(your random interval) ... comparing them will allow you to find out the time you want to run your movement.
The problem is how you represent distance, you can use straight x,y screen coords, or you can divide you "world" up into a grid, and have each grid square be one movement. There are a number of options as you can see...
for your bullet question, that too is solved by using a couple of variables to track some things, though unfortunately to do it properly will require more than a single if statement, most likely. first, you want to decide exactly how your bullets are going to work, how long you want between each shot, whether its going to be a time between shots, or only one bullet on the screen at a time etc. secondly you would need to choose how you want to represent your bullets in your program, in my opinion, the best way is to represent each bullet as an object of its own, complete with an x,y,z position and whatever other variables you think your bullets should have, such as speed, damage, perhaps a "type" to represent if it can harm certain other game objects or not, like shotgun shell, solid shot, armour piercing etc.
A really good example to look at for these kinds of things would be the Dark Invaders tutorial that comes with DarkGDK, its a sprite based space invaders clone, but it has in it, all of the things that you are trying to do in one form or another, the player can only shoot one bullet at a time, the enemies move a certain distance, then move down, then move again, you could adapt that quite easily to your ant idea. There are also a set of 6 webcasts that you can get to from the forums here, I think they are a sticky, that are a tutorial presented by Lee Bamber of TGC about Dark Invaders and DarkGDK.
If it ain't broke.... DONT FIX IT !!!