You'll just need to add new checks to help orient the bot to the task it needs to meet. If it has no money, sell. If it has money, buy.
I hope this helps! If you need more assistance, post on my forums at https://pposb.org/forums/index.php in the help section for OSRS Script Factory. That way more users who use Script Factory will see it