Selecting edges

My ultimate goal is to find what edges share a particular vertex. I will then use this to loop through those edges, but I am having troubles understanding vertex indexing and edge indexing. I think the only way I will understand this is to build a simple tool that gives a visual aid by selecting an edge, which is connected to a slider control. Then, as I slide the slider control, it will update which edge is to be selected, highlight it in the edit mesh mode, and then print out the edge index number and ed.v1.index and ed.v2.index in the cmd line.

This sounds pretty simple, but after reading the 2.49b api docs and searching through a few threads in here, it seams like the only way to deselect the last edge and select the new edge is to continuously loop through each edge check its selected state and change its value accordingly. For example, lets say I want to deselect edge index 100, then if I understand correctly the for loop would have to loop 100 times. If so, I am not sure why the programmers who developed Blender make that so difficult when other 3d apps such as Maya Mel does it like this

select -r myObject.e[100]
the -r stands for replace. So that means right off the bat, anything that was previously selected is now deselected, and no looping is needed.
the myObject.e[100] stands for to select myObject edge index 100

see how clean and simple that is?

or am I missing something in Blender that will do something similar to the Maya Mel example I gave above.