What an interesting story. I’ve noticed that the Ekottarika Agama contains quite a few of these avadana-type stories about various disciples scattered throughout. They seem to be background stories about why they were said to be famous for one virtue or quality or another in the early section listing out the prominent monks, nuns, laymen, and laywomen. That section is parallel to a similar section in AN, but I don’t believe that AN includes back stories in the form of sutras.
As far as the details of these stories in EA differing significantly from Pali sources, it’s one of the indications that EA descends from a Buddhist tradition that branched off from the Pali tradition at a very early time. Some parallels in EA are strikingly similar to Pali equivalents, and some are quite different.
What this line says is that he vowed to never fall asleep in the presence of the Tathāgata (終不在如來前坐睡) again. There’s an pretty interesting exchange that takes place after that in which the Buddha says that “all dharmas rely on food to survive” and relates that to the senses “feeding on” their sense objects. But the Buddha says that the eye “feeds on sleep” and tell Aniruddha he can go to bed, and it’ll help his eyes after Jiva(?) says that a nap would help his vision. Aniruddha, however, couldn’t sleep after waking up (the way I read the story).
Later, he has trouble mending his robes because his vision is still blurry. When he can’t thread his needle, he thinks, “Let a realized arhat thread this needle of mine.” The Buddha overhears this thought and goes to him and says, “Bring your needle. I’ll thread it for you.” Aniruddha humorously says, “Worldly people all pursue merits, but I just want to thread my needle.” The Buddha tells him that no worldly person pursuing merit could surpass him (the Buddha) because he has perfected six things: Generosity, instruction, patience, teaching Dharma and its meaning, leading sentient beings, and pursuing the way to unsurpassed awakening. Which sounds somewhat like a set of paramitas, but they are called dharmas here.
Aniruddha’s response is to say, the Tathagata’s body is a body of Dharma. Why would he pursue any of these things (dharmas)? After crossing the ocean of birth and death and being freed from craving and attachments, why would he pursue a path of merit?
The Buddha responds that while that is true, he also knows about these six qualities. If sentient beings knew that doing evil with body, speech, and mind, they would never again fall into the three unpleasant destinies. It’s because they don’t know this that they do.
The sutra is summed up by the Buddha with a verse:
“Of all the powers possessed by worldly beings
Who travel among humans and gods,
Merit is the highest of them all,
For the path to becoming a buddha comes from merit.”
The Buddha then instructs Aniruddha to train in the six qualities that the Buddha had mentioned earlier.