that's an attenuated version of the VIN that is termed an EIN, it would match the car that the engine came from.
so that looks to be a 1965 Riviera manufactured in Flint.
it decodes like this
5 = 1965
H = Flint Michigan Buick plant
940607 = sequential production number starting at 100001 but Electras and Rivs each had their own unique number series and the Riv series starts at 900001.
which, if the dual quad is original to the engine, should mean that it's a 425ci.
the two digit Engine Code stamping would provide a definite ID as to whether the engine was original dual quad or not, as well as displacement. it should show an "LX" for 1965.