In Gen III it added +1 happiness to positive happiness events. However, in Gen IV and V the Soothe Bell multiplies happiness gains by 1.5x (rounding down), not 2x. It would appear that "rounding down" is a key part of the equation, as, from what information I can find, happiness appears to be an integer value. A number without a fractional or decimal component.
So, while in theory the soothe bell should reward you with 1.5 happiness for every 256 steps, in practice that .5 is being rounded down. Additionally, it is +1 happiness for every 256 steps, not 0.00390625 happiness for every step. So in all likelihood, in your example, those 40,000 steps have only provided you their base +156 points of happiness.
EDIT: Forgot base Happiness; 70 for Riolu, which means, the total would be 147*256= 37,632 steps. Which you've more than passed. Have you leveled the Riolu at all? Pokemon that evolve through happiness still need to gain at least one level to trigger their evolution. It doesn't occur solely after the happiness threshold has been passed.
The Friendship page of Bulbapedia has a handy chart for Pokémon happiness events. There are three ways in Sinnoh to gauge a Pokémon's happiness; The Pokétch app Friendship Checker, Dr. Footstep on the left side of Route 213, Or a female NPC in the back of the Pokémon Fan-club in Hearthome City
Although perhaps not entirely relevant to your question, as your Riolu was hatched, Pokémon caught with a Luxury Ball receive additional happiness from leveling up and walking. This bonus stacks with the soothe bell.