The first thing you will need to get in place for this is making sure the weights are in the cart for the items. Do you have a weight column in your cart that you are binding with the column from your db for the items weight? If not you will need to do so by editing your add to cart server behaviors to ensure that the weight from the db is being added to the weight column in the cart.
Once you have the info being recorded you can just create the flat rate shipping rules. The first will have a trigger of subtotal of weight is < 5, then apply the flat rate of $10. The second will be subtotal of weight >= 5 and < 20, then apply the flat rate of $20. I'm including some screen shots of what the charges should look like in the cart.