Just like the "
code" BBcode, please add an optional "RTL" BBcode for Right-to-Left languages
This is very essential for writing in Right-to-Left languages.
Is your forum working in a genuine RTL environment (i.e. as shown for Hebrew or Arabic) or in an LTR environment with a few RTL writings?
In the first case you can alter the main template and set
<html dir="rtl"> for the whole document. For the second case your proposal is comprehensible but not complete. The script also has to be aware of RTL main language of the forum page and LTR writings within it.
Trenne niemals Müll, denn er hat nur eine Silbe!