Hello Sam. The following has been written by my son, Edward, who recognised this engine inside a few seconds.
"You have the engine unit from a German toy steam engine, made between the late twenties and late thirties by Doll. Originally it would have sat on a tin base with a horizontal boiler. The reference number underneath is correct: model 365, size 1. They ranged from size 1 to size 4, which had a 6" flywheel and sat on a base 23" by 18".
There were two versions of the engine, one had a single piston valve and both cranks going round together like a Triumph parallel twin; the other (like yours) has two piston valves and quartered cranks. The Walschaerts valve gear isn't original, its unusually complicated for a modification to a toy."
Mike Potts.