What is meant by the term "Code on request"?
Yes, I think you're correct although the phrasing is unusual. The usual phrase is "clearance on request", which is used for IFR departures as explained nicely in this AOPA article:


  Experienced instrument pilots know that when they call to request
  their clearance, the controller may not yet have received it.
  "Clearance on request" is ATC's way of politely saying "I don't have
  it - I've requested it - you'll be the first to know when I get it!"


The only FAA reference for the phrase that I could find is buried in the glossary of the Pilot's Handbook of Aeronautical Knowledge:


  Clearance on request.  An IFR clearance not yet received  after filing a flight plan.


But as RalphJ commented, if this is a VFR scenario and you needed a class B clearance and transponder code then I assume that the controller said "code on request" to let you know that he was waiting for a transponder code for you, as you assumed.

It wasn't an instruction as such so you could just acknowledge it with "Roger" or whatever. See this question for more information on that.