Accurate shipping is not easy to set up if you are configuring a CUSTOM shipping procedure.
The place to start is to decide how you are going to do your shipping / delivery and WHO you are going to use to do it. You may decide to use several shippers - or you could use a single agent if that agent meets all your delivery needs.
Anyway... once you've decided WHO you are going to use, you need to get a full schedule of their RATES, and get a good understanding of HOW they calculate those rates.
Today, shippers often use a combination of variables when quoting shipping charges and these can include WEIGHT, LENGTH x BREADTH x HEIGHT, and also a system called VOLUMETRIC WEIGHT.
These complicated variables are not easy to factor into your formulae for zencart, but you can get close to getting accurate calculations that result in your shop applying rates that are very close to the rates YOU will pay your shipper when they come to collect the consignements from your depot.
In the USA (and some other countries where they operate) you can use the UPS and USPS modules which take the data off your store, caluclate the applicable rate, then send that back to your store for the customer to use. The same applies to FedEx and DHL, and there are also other modules that enable such bi-directional communication with the shipper, sending back an accurate value to your store.
But if you use a smaller company, then (as I said) the first requirement is to get a full schedule and procedure of how they calculate their rates - and then (using this information) set up your custom shipping module to calculate the rates properly.
WEIGHT-based formulae are the "easiest" to configure, and VOLUMETRIC WEIGHT the most "difficult".
Then... you have to look at ZONES.
All shipping / postal companies will ALSO regard distance as a factor in calculating their rates. Some may also look at the HASSLE FACTOR (such as the UK's Royal Mail / ParcelForce who charge extra for delivering to remote parts of the UK, like the Scottish Highlands).
But in ALL CASES, your shipping modules will be set up using a combination of consignment WEIGHT/VOLUME , SHIPPING DESTINATION / DISTANCE.
If you are selling into a local/regional/national market, you may find that you can use one or perhaps two shipping modules, because the ZONE parameters are limited to just one or two options.
But if you are shipping internationally, then you may have to use several modules - each one dedicated to a ZONAL REGION - and possibly even to a specific shipper.
Once you have determined ALL your shipping methods (the practical side ... who is going to ship for you and what and how they charge), you will be in a better position to decide how many modules you need to configure, what those modules will be, and what formulae to use in each one.
The nice thing about many ZC shipping modules is that you can CLONE them (duplicate the module so you duplicate its FUNCTIONS) and use these CLONED MODULES to handle either different ZONES, or different SHIPPERS (or a combination of ZONE and SHIPPER).
When I learned how to CLONE these modules, many of my shipping frustrations disappeared, because I suddenly had unlimited flexibility in how to apply complex shipping functions to many of my clients' webshops.
There are lots of posts about how to clone modules.
The first step is (as I say) constructing a detailed analysis of who you want to use, what and how they charge, and where you want to deliver to...