If your controller does not require pedal input to operate, you can install a Cycle Analyst v3.x
The Cycle Analyst display is our first flagship product released in 2006 and now in its 3rd generation. While the hardware design may be showing its age, it still has capabilities and functionalities that are unmatched by modern ebike systems with their pretty colour screens. This device also...
ebikes.ca
between the throttle and controller, to take over modulation of the throttle. It's cruise function can be set to engage after holding the throttle steady at the speed you want for anything from 1 to 8 seconds, IIRC.
However, a better feature is that you can have variable-speed PAS using just a cadence sensor (probably even the one already installed on the bike--you disconnect it from the controller and connect it to the CA instead). The pedals can actually control the speed of the bike, just like pedalling a non-assisted bike would. (or you can control the power, or current). I use this method to control the speed of the SB Cruiser trike (with a throttle as backup, but I hardly ever use it except to start from a stop in some conditions--PAS does everything else as long as my legs aren't hurting too much).
You don't have to mount hte CA on the handlebars, either--if you won't want it there you can put it anywhere you like, since the data on the screen isn't why you're installing it. If you need to be able to change modes or the level of a variable function, you can do this remotely with a small handlebar-mounted control.
Another option is to find one of the old Crystalyte cruise controls (they might still sell them directly; they are still on their web page here
New Page 2 )
or to create one using something like the Arduino Nano or other tiny MCU (preferably one with an analog in and analog out, so you don't have to add AD/DA converters to it). There have been projects like this here on ES, though I dont' have any links.
There is also a project that uses a small MCU (PIC?) to take the PAS signal and turn it into a throttle signal (a very very basic version of what the CA can do like that).