There's a line over which every person with a conscience can't cross, and it appears that you've found yours. You were wrong to alter the books for personal gain or any other reason. Having done it before, you've now set up expectations with this shareholder that you'll do it again. You must immediately tell him that what he asks of you is impossible and that you won't do it again. Your bargaining position is weak since he knows you've bent the rules before, but you must remain firm in your response. You may be able to dodge the bullet this time if the shareholder keeps quiet to protect himself, but don't bank on it.
There are three possible outcomes from here. If the shareholder backs off and doesn't bring it up again, you have only the fear of waiting for the other shoe to drop. This may cause you to worry and affect your productivity, which ultimately won't help you excel at your job.
Second, if you think that you have enough support in management to confess your misdeeds without losing your job, you'd be wise to speak up. If what you did was truly minor, your actions might be perceived as poor judgment and not a lack of personal integrity, and you might be able to weather the storm. However, your employer also may fire you, so be prepared for this outcome. If you're kept on, it will take time for your employer to regain your trust, but at least you'll be working with a clearer conscience.
Third, you may choose to negotiate a parting of the ways with the shareholder by getting some type of "let go" fee and good recommendation in exchange for your resignation and silence. You'll immediately need to begin another job search if you go this route.
Nothing you'll have or achieve in life will be as important as your personal integrity. Don't dismiss the value of honesty, honor and virtue by acting in ways that compromise you. If you do, sitting in jail will be the least of your problems.