right, first time i decided to do a cut to the chase, but i been caught, there was more to the problem ...
which im mildly baffled about too! inconsistency, yeah.
perhaps some commands were built to accomidate this syntax because they couldnt be bothered building the strings all the time for such simple addressing for certain tasks.. dunno.
i think figured it. its that certain commands look to the current selectn to do their actn - " if obj not specified then works on selectn " kind of MO. what you'll find is that poly-type commands dont even give a flyers as to the variable infront of the component, it just looks at the slectn and the comp index ..... so if you have:
you'll extrude face 4 of the torus, the cube untouched. nice. so emit the $var (like it does), and set your sel before hand if you want to use it like that, else build your string to hand it. if you have nothing selected, it cant find the index on nothing.
pointPosition does have a bit more of a look at ts arguments, and thinks its trying to do two objects, which it doesnt like (same as other sel ctx commands) ... pointPosition $obj.vtx[2] returns the same error as if you did pointPosition .vtx[2] w two objs selected.
so, sorta inconsistant that some commands 'notice' the variable there and error, while others just think your a twit and move right along!
Ahh yeah well thats just bacuse some commands have default behaiviour and others dont! umm thenagain not in this case. (sorry im not in front of a maya so i cant test this right now)
but theres certainly seems something fishy with your script example (but ill try this at first hand)! try doing it inside a proc where the variables are explicitly defined since somethimes vars do carry over especialy if you type them in the script editor.