I can't figure out what やり is supposed to mean here since there is no kanji present in the sentence. I'm guessing the first part of the sentence means If you're done with that homework, but none of the やる verbs in the dictionary have a meaning close to that.

I am not sure what you mean by the word "stem" here, but certainly the origin goes way back to even around from 10th to 14th century.. The original kanji form varies, for example 遣(や）る 遣（＝meaning, send, summon, give, ) as a transitive verb, from above 徒然草 ( English Wiki ),

The Japanese original

明日（あす）その値（あたひ）をやりて牛を取らんといふ

The Japanese modern version

（牛を買う人は）明日その代金を払って牛を受け取ろうという。

English Tranlslation

(The person who buy the cow) says he will pay ( = give ) the money tomorrow and receive the cow.

or a subsidiary verb やる such as from 源氏物語 ( English ) to denote, do, finish.

The Japanese original

言ひもやらず、むせかへり給（たま）ふほどに

The modern Japanese

（母君は悲しみのために）最後まで言うこともできず、むせび泣きなさっているうちに。

The English translation

(The mother, due to her deep grief) was not able to finish to say to the last, crying and choking with..