(S)-ketamine presents potential for the management of acute pain and, more specifically, for the prevention of pain associated with care. However, the administration route can be a source of pain and distress. In this context, a smart formulation of (S)-ketamine was designed for buccal administration. The combination of poloxamer 407 and sodium alginate enables increased contact with mucosa components (mucins) to improve the absorption of (S)-ketamine. In this study, rheological studies allowed us to define the concentration of P407 to obtain a gelling temperature around 32 °C. Mucoadhesion tests by the synergism method were carried out to determine the most suitable alginate among three grades and its quantity to optimize its mucoadhesive properties. Protanal LF 10/60 was found to be the most effective in achieving interaction with mucins in simulated saliva fluid. P407 and alginate concentrations were set to 16% and 0.1%. Then, the impact of P407 batches was also studied and significant batch-to-batch variability in rheological properties was observed. However, in vitro drug release studies demonstrated that this variability has no significant impact on the drug release profile. This optimized formulation has fast release, which provides potential clinical interest, particularly in emergencies.