From the documentation of $Organization it's quite clear that possible values are
{!$Organization.Id}
{!$Organization.Name}
{!$Organization.Division}
{!$Organization.Street}
{!$Organization.City}
{!$Organization.State}
{!$Organization.PostalCode}
{!$Organization.Country}
{!$Organization.Fax}
{!$Organization.Phone}
{!$Organization.GoogleAppsDomain}
{!$Organization.UiSkin}
It does not contain IsSandbox
so you have to look for alternative.
Based on my Limited knowledge of VF I can say we can use AJAX Toolkit in VF.
AJAX Toolkit allows you to query any record and use JS to alter HTML and post your content.
Your code will be like:
<apex:page >
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/46.0/connection.js"
type="text/javascript"></script>
<script type="text/javascript"> window.onload = setupPage;
function setupPage() {
//function contains all code to execute after page is rendered
var state = { //state that you need when the callback is called
output : document.getElementById("output"),
startTime : new Date().getTime()};
var callback = {
//call layoutResult if the request is successful
onSuccess: layoutResults,
//call queryFailed if the api request fails
onFailure: queryFailed,
source: state};
sforce.connection.query(
"Select Id,isSandbox FROM Organization",
callback);
}
function queryFailed(error, source) {
source.output.innerHTML = "An error has occurred: " + error;
}
/**
* This method will be called when the toolkit receives a successful
* response from the server.
* @queryResult - result that server returned
* @source - state passed into the query method call.
*/
function layoutResults(queryResult, source) {
if (queryResult.size > 0) {
var output = "";
//get the records array
var records = queryResult.getArray('records');
console.log(JSON.stringify(records));
output = 'Is Sandbox '+ records[0].IsSandbox;
source.output.innerHTML = output;
}
}
</script>
<div id="output"> </div>
</apex:page>
Src: https://developer.salesforce.com/docs/atlas.en-us.ajax.meta/ajax/sforce_api_ajax_vf_sample.htm