I am particularly fond of going through my entire deck each turn. However while I like to do this, are there any actual rules for handling cases like "You just played a smithy, but there are only two cards in your deck which aren't either in play or in your hand"?
The rule is always that you do as much as you can of the card, in order.
So, if you play a Smithy, you would draw those two cards.
A case that is more illustrative of how the process works is Lookout. Lookout reads: "+1 Action, Look at the top 3 cards of your deck. Trash one of them. Discard one of them. Put the other one on top of your deck." If you only had two cards remaining in your deck, you would do as much of the card as you can, in order: