Hello R.,
You can use embedded diagram or sub-diagram with use of '{{' and '}}' on note (See similar question on /6947/embed-sub-diagrams-in-diagram-like-a-note):
Here is a proposal, with a simple "User State" embedded on a sequence diagram (with adding processing procedure just to avoid to repeat the state ):
@startuml
actor Client as C
participant Server as S
control "User state" as U
!procedure $UserState()
title User state
D : disconnected
C : connected
D -> C : connects
C -> D : disconnects
!end procedure
== Init ==
note right U
{{
$UserState()
state D #palegreen
}}
end note
== Exchange ==
C -x S : Attempt to connect
note right U
{{
$UserState()
state D #palegreen
}}
end note
|||
C -> S : Connects
note right U
{{
$UserState()
state C #palegreen
}}
end note
S -> C : Ack
|||
@enduml
And the result:
[See on PlantUML online server]
If that can help,
Regards,
Th.