Here's a breakdown of what you need to consider:
* Engine Code: The engine code (a series of letters and numbers usually found on a pad on the block) is crucial. This will identify the exact engine's specifications (year, internal components, etc.). Using an engine with a similar or identical code will simplify the swap tremendously.
* Year of the Replacement Engine: While many 350s are physically similar, computer systems and emission controls changed significantly over the years. Using a substantially newer or older engine might require extensive modifications to your truck's wiring harness, ECM (Engine Control Module), and possibly other components. Staying within a similar era (e.g., late 80s to early 90s) is strongly recommended for a simpler swap.
* Fuel Injection vs. Carbureted: Your 1991 Z71 likely had a TBI (Throttle Body Injection) system. Swapping in a carbureted engine would involve a massive amount of work and is generally not recommended. Sticking with TBI or even a later generation fuel injection system (like sequential port fuel injection) would be far easier.
* Accessories: Consider the accessories (alternator, power steering pump, AC compressor, etc.). While the mounting locations are generally consistent on small-block Chevys, you might need to adapt brackets or pulleys to match your existing accessories or the replacement engine's accessories.
In short: The easiest and most compatible 350 replacement would be another TBI 350 from a similar-year GM truck. Anything outside of that will require varying degrees of mechanical and electrical expertise and parts.
Before undertaking any engine swap: Consult a repair manual specific to your 1991 Silverado Z71. It will provide details about the specific engine and the requirements for a successful swap. You'll also need to research the compatibility of the replacement engine's components with your truck's existing systems.