Both of these questions are very difficult to give a solid answer to, because both depend on what's out on the board. If there's a solid $5, like say Mountebank, it wouldn't be surprising for you to pass up Gold twice to pick a few up. On the other hand, if the only $5's on the board are Explorer and Counting House, well, you're probably making the right choice grabbing Gold every time. Most boards of course are somewhere in between, and really it's judging those which is half the skill of the game. A good start is to get out of the habit of $6 instantly meaning Gold: Consider if one of those $5's might be more useful, and if you're likely to reach $5 again before shuffling.
As for Silvers, it depends on what kind of deck you're building. A deck which is treasure heavy (such as any 'big money' engine) should never stop buying silvers unless you're going for Colonies, and even then, I don't think you'd be going too wrong picking up more Silvers. On the other hand, if you're building an engine, you need to weigh the options carefully: Will an extra silver help with your buying power, or will it just clog up your engine? Some engines want Silvers pretty much indefinitely (e.g. a Cellar-Festival-Library engine would like Silvers to the end, I suspect) while others don't care or outright dislike them beyond the earlygame (e.g. most chapel engines would like to stay at about 1-2 silver, so they can grab those golds/good actions more often)