You only need to create an "agent" if you plan to have it constantly running, over and over.

At this time, you probably don't need that, right?   All you really need to be able to apply your code manually, one deduction at a time.  Once it all works and is doing the right thengs, then youcan automate it to run automaticaly.