Heat oven to 350º F. Combine chocolate and butter in a small saucepan over very low heat, stirring occasionally. When chocolate is just about melted, remove from heat, and continue to stir until mixture is smooth. Meanwhile, grease an 8-inch-square baking pan. If you like, also line it with waxed or parchment paper and grease that.
Transfer mixture to a bowl, and stir in sugar. Beat in eggs, one at a time. Add flour (and salt and vanilla if you are using them), and stir to incorporate. Stop stirring when no traces of flour remain.
Slice the SPAM into sticks. Pour the mixture into a buttered pan or parchment-lined pan. Arrange the SPAM to your liking.
Bake 20 to 30 minutes, or until set and barely firm in the middle. Cool on a rack before cutting.