It depends on how your heuristics.py is defined, but most use the item key for the run number, which is the index of the group is from. I believe it should be consistent, the files read from the filesystem are sorted before being used.
heudiconv groups the series in ascending order - you can see the order of a particular subject’s scan if you look at the dicominfo.tsv file generated in <output-directory>/.heudiconv/<subject>/info/
so if you have two T1 series during a scan session (1 at the beginning and 1 at the end) and you assign both to a key with the {item} formatter, item-1 will be the first scan and item-2 will be the last.