For your question about if/then statements, I'm pretty sure that is possible with functions.
Also, about money, you could use a scoreboard to store the values. In case you want to take out some coins, you could easily make a function that removes a certain amount of coins, and puts it in the form of firework charges in somebody's inventory.
If you really want to stick with your idea of economy being purely in inventories, you could name the coins. I'm pretty sure that items with different names don't stack. Also, you should be able change the color.
Also, on buying items, you could make specialized functions. Also, I think you should use signs instead of command blocks to do all this if it is based on functions.
If you're wondering what functions are, that are a new feature in 1.12. At least, I'm pretty sure that's right. Take everything I said with a grain of salt. :D